Home > Mobile >  Is there a way to enalble public cache and disable private cache in the same time?
Is there a way to enalble public cache and disable private cache in the same time?

Time:12-01

We have enabled cloudfront caching. In order to make cloudfront caching function we added Cache-Control header to respons on specific paths for example example.com/page/1. The response header includes:

cache-control: public, max-age=31556952

It seems thogh that by adding this header I have enabled browser's(private) cache as well, not just public cache (proxies, CDNs etc). The effect I would like to achieve is to have public cache working, but to prohibit private(Browser, user agent) caching. Is that possible? If yes - how?

CodePudding user response:

No, that's not possible. The public directive means that "any cache MAY store the response".

It's hard to imagine a use case for allowing caching for every user (public cache) while at the same time disallowing it for any particular user (private cache).

  • Related