cache-plugin icon indicating copy to clipboard operation
cache-plugin copied to clipboard

s-maxage Cache-Control directive is ignored

Open xabbuh opened this issue 6 years ago • 1 comments

Q A
Bug? yes
New Feature? no
Version all

Actual Behavior

When you are initialising the CachePlugin in server mode (using CachePlugin::serverCache, for example), the s-maxage directive of the Cache-Control header is never taken into account which means that cacheable responses are always cached with the default TTL.

Expected Behavior

The s-maxage directive is used as the TTL for cached responses.

Steps to Reproduce

Send requests to an endpoint where the shared max age directive's value of the Cache-Control header is different than the default TTL. Cache entries will expire after the default TTL.

xabbuh avatar Dec 18 '17 13:12 xabbuh

i guess that would indeed make sense. in server mode, the plugin does manage a shared cache so s-maxage seems reasonable.

dbu avatar Dec 18 '17 13:12 dbu