Hello Again,
I have been reading over cache documentations alot lately... and, I hate to admit, I'm still lost.
I've done some searching on the forum, but have not found the answer to my questions. (Some responses looked good, except that they didn't appear to be in english... or poor english, so I got quickly lost).
Anyway, here is what happens:
I have images, static pages and dynamic pages. I want to cache some of the images for weeks at a time. They won't be changing. I want to cache the static pages at about 1 week. I also want to cache the main news page at a day.
Now, there are scripts such as /read (which is php file but the type is forced with .htaccess). A user's account would be /read/myUserName.
Now, all of the php scripts access a top.php file... so they all share the same header info.
So, I assume, based on the script_name, i'm going to have to set the header info? (if its different?)
Now, here's where I show my stupidity... (but at least i recognize it right? :-D)
Here's my header code I found (before i learned about cache's)
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// ie bug
header("Cache-control: private");
Obviously, this is incorrect! This allows no caching of any of the pages, right?
But even after reading all of my documents, I still don't know how to set this information.
What I'm thinking is... for "last modified", I need to set that to filemtime of the file its referencing?
But what about the /read script? Does that one need to be set to not cache?
If you understand my questions, I apprecaite your input! 🙂
-Aaron