TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-24-2007, 07:49 PM   #1 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default How do you 'cache' a page?

I have a few pages that run about 15 queries, now I know that's not much but I'd like to expand on the page so it runs double that :eek:

So I was wondering if it would be possible to cache a version, or part of, the page and display that instead? And maybe the cache is refreshed every ten minutes or so.

Is it possible?

Is it easy? :confused:

Any help appreciated!
__________________
PS3 Forums on GameSlurp - the site for gaming fans!
Brook is offline  
Reply With Quote
Old 02-27-2007, 03:36 PM   #2 (permalink)
The Wanderer
 
Join Date: Mar 2005
Posts: 17
Thanks: 0
mikem is on a distinguished road
Default

You could store a copy of the generated page in the database or in a text file then just load that copy as needed instead of generating the page for each view.

To update the page you could do that whenever one of the values shown on the page is changed (ie: inserting/deleting/updating a row that would change the cached page).

Another option might be storing the time that the cached page was generated. When fetching the page, determine if the time is more than x minutes in the past. If so, then regenerate the page, update the last generated time and continue on as normal.
__________________
Mike
::Shrapnel-Network::
www.shrapnet.com
mikem is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:17 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design