Skip to content

Commit d413993

Browse files
authored
tweaks
1 parent b2bb888 commit d413993

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

components/cache.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,14 @@ is computed again. The next second the same thing happens. So the data is comput
9999
about 50 times before the cache is warm again. This is where you need stampede
100100
prevention
101101

102-
The first solution is locking: on a per-host basis, only one PHP process is
103-
allowed to compute a specific key at a time. Locking is built in by default so
104-
that you don't have anything specific to do other than leveraging the Cache
105-
Contracts.
106-
107-
The second solution is also built in when using the Cache Contracts: instead of
108-
waiting for the full delay before expiring a value, it is recomputed ahead of its
109-
expiration date: the `Probabilistic early expiration`_ algorithm randomly fakes a
110-
cache miss for one user while others still are served the cached value. You can
102+
The first solution is to use locking: only allow one PHP process (on a per-host basis)
103+
to compute a specific key at a time. Locking is built-in by default, so
104+
you don't need to do anything beyond leveraging the Cache Contracts.
105+
106+
The second solution is also built-in when using the Cache Contracts: instead of
107+
waiting for the full delay before expiring a value, recompute it ahead of its
108+
expiration date. The `Probabilistic early expiration`_ algorithm randomly fakes a
109+
cache miss for one user while others are still served the cached value. You can
111110
control its behavior with the third optional parameter of
112111
:method:`Symfony\\Contracts\\Cache\\CacheInterface::get`,
113112
which is a float value called "beta".

0 commit comments

Comments
 (0)