Creator of Souin HTTP cache
Træfik helper/ambassador
Cache-handler maintainer
Open-source contributor
@Darkweak
@Darkweak_dev
Join onestlatech in 🇫🇷
HTTP/1.1
Caching would be useless if it did not significantly improve performance
If a stored response is not "fresh enough" [...] the cache MAY still return the response with the appropriate Warning header
<esi:include
src="http://example.com/1.html"
alt="http://bak.example.com/2.html"
onerror="continue"
/><esi:try>
<esi:attempt>
<esi:comment text="Include an ad"/>
<esi:include src="http://www.example.com/ad1.html"/>
</esi:attempt>
<esi:except>
<esi:comment text="Just write some HTML instead"/>
<a href=www.akamai.com>www.example.com</a>
</esi:except>
</esi:try><esi:vars>
<img
src="http://www.example.com/$(HTTP_COOKIE{type})/hello.gif"
alt="$(HTTP_COOKIE{logo_name})"
/>
</esi:vars><img
src="http://www.example.com/human/hello.gif"
alt="My human GIF"
/>HTTP/1.1 Caching
Age: 10Age: -5The Cache-Status & Target-Cache-Control HTTP response Header fields
Cache-Status: Your-Cache-Server; hit; ttl=3; key=your-patternCache-Status: Your-Cache-Server; fwd=uri-miss; fwd-status=304Cache-Status: Your-Cache-Server; fwd=uri-miss; detail=STORAGE-UNREACHABLECDN
Varnish
Caddy
Upstream
CDN
Varnish
Caddy
Upstream
CDN
Varnish
Caddy
Upstream
Cache-Control: no-store
CDN-Cache-Control: public, max-age=120, s-maxage=120
Varnish-Cache-Control: public, max-age=360, s-maxage=360
Caddy-Cache-Control: public, max-age=3600, s-maxage=3600CDN
Varnish
Caddy
Upstream
Cache-Control: no-store
CDN-Cache-Control: public, max-age=120, s-maxage=120
Varnish-Cache-Control: public, max-age=360, s-maxage=360
Caddy-Cache-Control: public, max-age=3600, s-maxage=36003600s
CDN
Varnish
Caddy
Upstream
Cache-Control: no-store
CDN-Cache-Control: public, max-age=120, s-maxage=120
Varnish-Cache-Control: public, max-age=360, s-maxage=360
Caddy-Cache-Control: public, max-age=3600, s-maxage=3600360s
CDN
Varnish
Caddy
Upstream
Cache-Control: no-store
CDN-Cache-Control: public, max-age=120, s-maxage=120
Varnish-Cache-Control: public, max-age=360, s-maxage=360
Caddy-Cache-Control: public, max-age=3600, s-maxage=3600120s
Cache-Control: no-store
CDN-Cache-Control: public, max-age=120, s-maxage=120
Varnish-Cache-Control: public, max-age=360, s-maxage=360
Caddy-Cache-Control: public, max-age=3600, s-maxage=3600Client
no-cache
First group
Second group
Third group
key 1
key 3
key 564
key 90
key ABC
key 3
key 789
key 1
key 789
https://github.com/http-tests/cache-tests
https://cache-tests.fyi
👇That's the French paracetamol👇