slimphp / Slim-HttpCache

Slim Framework HTTP cache middleware and service provider
MIT License
115 stars 25 forks source link

Use no-cache header when max-age is zero #21

Closed andybeak closed 7 years ago

andybeak commented 7 years ago

You could previously accomplish this by doing something like this

$app->add(new \Slim\HttpCache\Cache('private, no-cache', 0, true));

But this results in a header like this: "private, no-cache, max-age=0, must-revalidate".

A neater header that is more standard is "private, no-cache" which will have the effect of stipulating that the cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server.