Jump to content

Cache-Control header... or lack thereof...


seodevhead

Recommended Posts

Hey gang,

 

I have a quick question regarding the Cache-Control header (or lack thereof).

 

I built a fairly large php/mysql based website that is very interactive for users, much like forums are.  Though there is a user registration, most pages are visible to the public, and being a registered member only gives you access to post comments etc... similar to a blog.

 

Right now, all my php pages are served with NO Cache-Control header... it is not sent to the client at all.  But on these very pages I use cookies to test whether visitors are logged in to my site, and if so, that page will display things like form fields and text boxes where they can submit comments.  Unregistered users simply don't see those forms.

 

This is all pretty standard stuff... but I am worried that a registered user will get one of these pages cached in a proxy cache or public cache (since there is no explicit Cache-Control header sent) and didn't know whether or not I was vulnerable to random unregistered people pulling a public cache of a page on my site that was only meant to be seen by registered users.

 

I hope my questions makes sense.

 

And if this is the case... do all I need to do is append a 'Cache-Control: private, must-revalidate' header to all my php pages?

 

I guess the biggest question is, am I at risk by not using a Cache-Control header... at risk of my "registered-only" page content being publicly cached, that is?

 

Thanks so much for any help and guidance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.