In install.txt you say:
This module relies on cron to remove stale files, so you'll want cron to run often, say every 5-15 minutes.

How do you define 'stale'?

I see that when I edit a cached page, the cache refreshes properly.

But when a block content changes, the page looks the same, cache does not refresh. Is that normal? Would such page not refresh until the next cron run?
If so, then any pages with dynamic content block would become so static as to render this caching counterproductive. What's your planned steps to mitigate this problem and when are they going to happen?

Comments

jeremy’s picture

Status: Active » Closed (works as designed)

There are a couple of reasons that the cache does not get deleted each time content changes:

  • On a busy website that is updated a lot (new content, comments, etc), if you clear the cache each time something changes, then your cache never actually gets used. Thus, it is preferable to enforce a minimum cache lifetime. The core Drupal cache offers the same feature, for this reason.
  • Each entry in the file cache is written to the file system. To invalidate the entire cache, you have to recursively scan the cache directory and delete each file you find. This can be time consuming and will cause page loads to hang (certainly it would happen on the _exit() hook, so the page is already displayed) -- if someone is clicking through your site and triggers a cache flush, odds are they won't stick around long enough for it to happen.

When block content changes, there's no way to know which cached pages have been affected, so it becomes an all or nothing thing... you have to flush the entire page cache.

Thus, the solution utilized by this module is the enforcement of a minimum cache lifetime. That lifetime is the length of time between cron runs -- if you want it short, then have cron run more frequently. If you want it long, then have cron run less frequently.

If it is critical to you that the cache is flushed each time content is added to your website, this probably isn't the module for you. On the other hand, if you have a very busy website and are trying to take some of the load off the database, then this module could help you quite a lot.

l8a’s picture

just to get this.

all pages are cached.
this is done only for anonymous users.
cache get resetted/deleted EVERYTIME ANY content changes on the site.
but this (line above) get not triggered THAN - but when the next cron runs.

do I got you right?