I want all requests to use both cache (application cache-control 1 hour TTL) and staled cache (1 year). This ensures all the requests get served with cache/staled content while fetching for a new copy in the backend. I also have CloudFront in front of LiteSpeed servers. I want to set the response cache-control to no-cache when staled content is served so CloudFront can get a copy of the staled content and serving it without caching. This ensures the second request to the same URL is coming back to the litespeed server to get the freshed content. Is there anyway to detect if the response is a staled copy and set/change the response header conditionally?
