Cache Pages
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
I'm not clear on the cache process (I've not been one to utilize caching in my applications to this point, since most of them are backends for company databases). Is the assertion that dynamic content scripts, i.e. one that pulls data down from a (or many) SELECT statements should not bother with a generalized cache mechanism because MySQL caches the SELECT output? That the cache should be for static content only?
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
I just found this, and can't I just use:
To make it cache the page that is sent to a user. (Browser Caching)
Code: Select all
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Data passata
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// sempre modificato
header("Cache-Control: store, cache"); // HTTP/1.1
header("Cache-Control: post-check=1 pre-check=1", true);
header("Pragma:cache"); // HTTP/1.0- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Let me give you an example, I had a spider that would run once a day to check for new content throughout several major site networks, this collected a massive amount of information and page loads were getting to a couple seconds (which sucks). Instead of pulling up a massive list of datum dynamically, I would cache the data once per day (each time the spider ran).bdlang wrote:I'm not clear on the cache process (I've not been one to utilize caching in my applications to this point, since most of them are backends for company databases). Is the assertion that dynamic content scripts, i.e. one that pulls data down from a (or many) SELECT statements should not bother with a generalized cache mechanism because MySQL caches the SELECT output? That the cache should be for static content only?
There are many ways to deal with the logic behind caching, be it a timeframe or logical.. but caching is not limited to static content at all. By eliminating the need to re-run processes that consume processor cycles, caching become very important when there is a need for high performance.