About caching (2)
| From: | Peter Billen | Date: | Thu, 26 Dec 2002 21:17:41 +0000 |
| Subject: | About caching (2) | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6946@lists.php.net to get a copy of this message | ||
Hi,
Another caching question for you :)
Imagine you have a site that contains several pages (let’s say 1000
pages) and that each page is generated by +/- 50 (do not ask me why :p)
database queries and that you cache each page (so you have 1000 unique
cache files). So actually, after the first click on page x, your total
dbase queries = 0. Now imagine that you have changed something in the
database, something that is shown on (almost) EVERY of those 1000 pages.
How do you handle with such situations? The only solution I can find is
deleting/flushing the whole cache directory, but then, you have to
re-query everything again (as in 1000 * 50 queries) on the first click.
An optimal solution would be that you can cache each query. So after
editing something in the database, you ONLY have to re-query THAT query,
and not:
→ 1000 x that query for each page
→ on each page: 49 x the others queries, who haven’t changed!
Any ideas?
Thanks,
Peter