Camen Design Forum

Delete

(Leave this as-is, it’s a trap!)

To delete this post you must be either the original author or a designated moderator.
The content of the post will be removed but the name and date will remain.

  • The post will be removed completely from the thread, rather than blanked
  • Only posts on the last page of the thread can be removed completely (so as to not break permalinks)

RE: PHP and filesystem efficiency?

Dan Zollman

First off, I don't know the answer to your question.

Second, I have a similar caching mechanism, but with selective removal. It works well because of the way my blog system is structured; I don't know whether it would be a good idea to generalize this for other sites, but maybe it's worth sharing.

There are three parts to the process:

1. In the cache directory, there is a folder for each URI minus the GET parameters. For example, there is folder for article.php. Inside that folder, there is a cache for every combination of GET params: article.php?foo=1, article.php?foo=2, etc.

2. When a given page is changed, the page's cache folder can be deleted. When a comment is posted on article.php, then the article.php cache folder is deleted. Even if there were multiple versions from different GET params, that takes care of all of them.

3. Each function that affects page content has a set of instructions or a pattern that describes what cache items need to be removed. When a new article is posted or updated, the cache for every article listing page is cleared.

I only delete the entire cache when I'm pushing an update to the site itself.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn