Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
memcache
Commits
52731350
Commit
52731350
authored
Mar 28, 2012
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1150072
by catch: Review expires handling.
parent
91af33a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
memcache.inc
memcache.inc
+8
-5
No files found.
memcache.inc
View file @
52731350
...
...
@@ -138,11 +138,14 @@ class MemCacheDrupal implements DrupalCacheInterface {
$cache
->
expire
=
$expire
;
}
// We manually track the expire time in $cache->expire. When the object
// expires, we only allow one request to rebuild it to avoid cache
// stampedes. Other requests for the expired object while it is still being
// rebuilt get the expired object.
dmemcache_set
(
$cid
,
$cache
,
0
,
$this
->
bin
,
$this
->
memcache
);
// Manually track the expire time in $cache->expire. When the object
// expires, if stampede protection is enabled, it may be served while one
// process rebuilds it. The ttl sent to memcache is set to the expire twice
// as long into the future, this allows old items to be expired by memcache
// rather than evicted along with a sufficient period for stampede
// protection to continue to work.
$memcache_expire
=
$cache
->
expire
+
((
$cache
->
expire
-
REQUEST_TIME
)
*
2
);
dmemcache_set
(
$cid
,
$cache
,
$memcache_expire
,
$this
->
bin
,
$this
->
memcache
);
}
function
clear
(
$cid
=
NULL
,
$wildcard
=
FALSE
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment