@@ -24,6 +24,8 @@ Installation
2424
2525 .. include :: /components/require_autoload.rst.inc
2626
27+ .. _cache-psr-6-versus-simple-cache-psr-16 :
28+
2729Cache Contracts versus PSR-6
2830----------------------------
2931
@@ -51,7 +53,7 @@ This component includes *two* different approaches to caching:
5153Cache Contracts
5254---------------
5355
54- All adapters supports the Cache Contract. It contains only two methods; ``get `` and
56+ All adapters supports the Cache Contract. It contains only two methods; ``get `` and
5557``delete ``. The first thing you need is to instantiate a cache adapter. The
5658:class: `Symfony\\ Component\\ Cache\\ Simple\\ FilesystemCache ` is used in this example::
5759
@@ -87,10 +89,10 @@ The Cache Contracts also comes with built in `Stampede prevention`_. This will
8789remove CPU spikes at the moments when the cache is cold. If an example application
8890spends 5 seconds to compute data that is cached for 1 hour. This data is accessed
899110 times every second. This means that you mostly have cache hits and everything
90- is fine. But after one hour, we get 10 new requests to a cold cache. So we start
91- to compute that data again. The next second the same thing happens. So we start
92- to compute that data about 50 times before the cache is warm again. This is where
93- you need stampede prevention.
92+ is fine. But after one hour, we get 10 new requests to a cold cache. So the data
93+ is computed again. The next second the same thing happens. So the data is computed
94+ about 50 times before the cache is warm again. This is where you need stampede
95+ prevention
9496
9597The solution is to recompute the value before the cache expires. The algorithm
9698randomly fakes a cache miss for one user while others still is served the cached
0 commit comments