Reputation: 162
im a web dev trying to improve TTFB performance on websites which tolerate serving stale content.
I try to configure something similar to vercels incremental static regeneration or similarly the stale-while-revalidate
cache-control header in http.
The idea is to initially fetch the upstream response and then subsequently serve the stale cached response. but once the cached object becomes stale the cache layer should still serve the stale content while fetching the fresh content upstream in the background.
I currently use traefik as a reverse proxy and a caching layer provided by souin. that is why my question is souin specific.
My current cache-control response headers are public, max-age=120, stale-while-revalidate=3600
and i would expect souin to interpret it so the content is treated as fresh for 2m and serving stale responses while refetching asynchronously for 1h.
But souin ignores the stale-while-revalidate strategy so I assume it is not implemented in the cache layer and expected to be used as a client caching strategy only.
I don't know enough about caching to make headway. If someone could point me in the right direction or resources to read I would be rather thankful.
Upvotes: 0
Views: 148