Search code examples
phpheaderhttp-headerscache-control

page cache theory - will this work?


I'd like to setup browser caching on my site. The problem is that the caching will only be for guests, not logged in users. I know I can throw different headers based on a user's logged in status, but how will the cache treat that? Do I run the risk of guests seeing user's content?

update

What I'm talking about is if i throw a last-modified header for all guests and force a fresh page for all logged in users. I suppose this would only help so much... I'd like it if all guests could share a proxy cache and all members could stick with fresh pages, but I don't think that would work.

How do both @Victor and @klausbyskov have a +1 on their response, they appear to be saying the opposite things.


Solution

  • The cache is in the browser. Therefore it is not possible for a guest to see a user's content.