Making an Advanced cache system

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
afshin.m
Forum Newbie
Posts: 2
Joined: Fri May 28, 2010 12:43 am

Making an Advanced cache system

Post by afshin.m »

Hello,

I'm programming an advanced caching system that work with PHP but i have an small problem.

I want to know when the pages content changed to remove the page cache from cache folder and make a new cache file with new content.

i don't want to work with cache time...

Please help me, thanks a lot. :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Making an Advanced cache system

Post by John Cartwright »

afshin.m
Forum Newbie
Posts: 2
Joined: Fri May 28, 2010 12:43 am

Re: Making an Advanced cache system

Post by afshin.m »

okay, i know this function and also use it now but i don't want to work with Time, i want to changed and renew my cache file ONLY when the page content changed.

Thank you
Brenden
Forum Newbie
Posts: 12
Joined: Fri May 28, 2010 2:12 am

Re: Making an Advanced cache system

Post by Brenden »

Well that's just the thing. In order to detect if the page has changed, you need to run the process that creates the page, in which case there's no point at caching at all. What I would do is approach it by either doing it at a regular interval, or running enough of the script to determine if the full script will change - ie, if the page involves listing and processing information from a database, keep track of how many items are on the list then refresh the cached page if that number increases. That way you are using SELECT COUNT(*) FROM table instead of running the entire script.
Post Reply