Cache function
Posted: Mon Jul 27, 2009 6:55 am
Hi All,
I'm thinking of writing a cache function for my website. I am thinking of doing a time based and/or sql based cache solution. My data changes about 20-30 times throughout the day, so I was wondering if it is wise to use caching or should I keep running the queries? Another question that I have is, if I decide to go for a caching function how would one deal with pages that also have pagination? That last one is bugging my mind on how to solve it. Especially when the pagination could contain up to 50 pages in total and I think that caching 50 pages is not wise, especially when data changes and you have to clear the cache and generate 50 new pages.
So my main question is: How would I solve the pagination issue? Maybe by caching the 5 first pages only?
Any ideas and tips are very much welcome..
Thanks. )
I'm thinking of writing a cache function for my website. I am thinking of doing a time based and/or sql based cache solution. My data changes about 20-30 times throughout the day, so I was wondering if it is wise to use caching or should I keep running the queries? Another question that I have is, if I decide to go for a caching function how would one deal with pages that also have pagination? That last one is bugging my mind on how to solve it. Especially when the pagination could contain up to 50 pages in total and I think that caching 50 pages is not wise, especially when data changes and you have to clear the cache and generate 50 new pages.
So my main question is: How would I solve the pagination issue? Maybe by caching the 5 first pages only?
Any ideas and tips are very much welcome..
Thanks. )