We have the stale-while-revalidate plugin in place and have noticed some 
behavior that seems suboptimal.  While cache is fresh, everything works great.  
The first page hit after our 300sec s-maxage has passed comes back with 
“Warning: 110 Response is stale” as expected.  However, it appears to be 
deleting the cached file and then looking at the origin server to pull fresh 
content.  Our origin servers aren’t exactly fast (hence the need for ATS), so 
this results in about 4 sec of time while that cache file doesn’t exist and any 
hits to that page need to wait for the content from the origin server.

Additional information:
s-maxage=300
stale-while-revalidate=604800
stale-if-error=31536000

When Age < s-maxage:

  *   Via: ApacheTrafficServer/4.2.0 [cHs f]

First page load after Age > s-maxage:

  *   Via: ApacheTrafficServer/4.2.0 [cHs f]
  *   Warning: 110 Response is stale

At this point, Cache Inspector shows the cached file to be missing for 3-4 
seconds

Subsequent page loads during revalidation process:

  *   Via: ApacheTrafficServer/4.2.0 [cMs Sf]
  *   This page load also shows a cookie being loaded that only comes from our 
origin servers

After the 3-4 second revalidation process, everything seems to go back to 
normal.

I might just be missing something but this doesn’t appear to be working as 
designed.  Does anyone know how I can get it to continue showing stale cache 
during the entire revalidation process?

Thanks,
.: Jared

Reply via email to