Expiring Pages so they dont stay cached

They have: 49 posts

Joined: Dec 2001

Yeah I just finished my website, RecipeBOMB.com and I'm noticing a problem with my login that never happened up until recently. To use most of my site the user has to login. However if they login, go to a page that requires login, logout, and go page to the page, it will appear as if they were logged in. Does that make sense? It also works the other way, if the user is not logged in, go to a restriced page and see the "false logged" error, then log in and go back to that page, it may load off the server or load the "false logged" page out of cache. If you press "Reload" it will fix itself and display correctly. I'm sure that this is the problem, the page is being loaded out of cache not that there is errors in my code.

I know that the browser will manage alot of the caching but isnt' there a way as a web author to make sure that the page is being loaded out of the server not the users cache? I've see other web sites that do such a thing.

Can anyone help please?

Krash_io
RecipeBOMB.com
ComptuerBOMB.com

Busy's picture

He has: 6,151 posts

Joined: May 2001

you can use the meta no cache tag
are you using cookies?

They have: 49 posts

Joined: Dec 2001

Yes and no. Ok, a users login session in managed with Cold Fusion session variables. But I check to see if that user is logged in, if they are then I set a cookie, if they are not logged in then I set a cookie with the same name to expire.

I set a cookie using CFCOOKIE without passing it the "expires" attribute. Doing so never actually sends the cookie to the client, it is stored in the servers memory. So a cookie is never actually sent to the client. I've emptied and watched my temporary internet files and cookies folder to make sure a cookie is never sent.

One thing that is weird is when the session variable for the user says they are not logged in, i set the cookie value to "EXPIRED". So then where I normaly see the logged in users name (the name is read from the "cookie" when the user is logged in) i see "EXPIRED" because its reading from the cookie. The session variable isn't totaly destroyed until the user closes the browser.

I just can't figure out why this is happening. This code was ran off my local machine and the ip address of recipebomb.com and was never changed.

I'm pretty sure that making sure the pages aren't cached will solve the problem, like I said pressing refresh corrects it right now.

Krash_io

Busy's picture

He has: 6,151 posts

Joined: May 2001

different browsers have different support for meta tags (suprise suprise) so you really need all 3 of the above.
other useful meta tag stuff can be found here http://vancouver-webpages.com/META/ (bottom frame)

Hope this helps, if not the CF pros will be along soon Smiling

They have: 49 posts

Joined: Dec 2001

Busy,

Ok, if I use thoes methods then the pages will not be cached. I'm sure that some browser can be configured to ignore this.

What about my images?? Will thoes still be cached or will the user have to download them every time?

Thanks,

Krash_io

They have: 49 posts

Joined: Dec 2001

Ok I tried using the META tags you suggested, and I even found another link on them to verify them at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067 but the pages are still being cached. I empty and watch my temporary internet files folder and the pages keep popping up in there!

I do have one question that maybe someone can answer. Click on the above link, see where it says "(Q234067)"? What is that number? I noticed one user viewed my site and there browser was reported as "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461)" - I see another similar Q number there. My browser is reported as "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)".

Can anyone tell me what that Q number represents? Perhaps version number? Maybe that is why the META tags in my page don't prevent cacheing.

Krash_io

detox's picture

They have: 571 posts

Joined: Feb 2001

As far as I know that is just the ID number of the question itself....

I dont think it has anything to do with your caching issues. Is everything working now?

They have: 49 posts

Joined: Dec 2001

No, the pages are still being cached.

I don't think that Q number is the ID of the question becasue like I said, I see that number next to the users browser when they visit my page.

Hope someone can help me

Krash_io

They have: 49 posts

Joined: Dec 2001

Anyone else have any ideas???

Busy's picture

He has: 6,151 posts

Joined: May 2001

I think that Q234067 number is a calling code, calls that info from database, or in html terms its an anchor, like link would go if click on (totally different but goes somewhere but id name or number.

did you try

as mentioned on that page?

how are you testing? if your testing on your own machine it may be caching through local folders, clear your internet temp folder and test with opera, opera is bad for holding onto cached files, so if opera wont cache it, the others shouldnt either.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.