I would like to request a feature where Boost will only refresh the cache when there is a change in the node.

Currrently, I set "Boost - HTML - Default maximum cache lifetime" = 3 hrs. Every 3 hrs, the page is refreshed because I saw the expired date time at the bottom of the page keeps changing every 3 hrs. It would be great if Boost doesn't refresh the cache when there is no changes.

thx!

Comments

mikeytown2’s picture

There's a setting for that
Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron.

This is sitewide; if you make a change somewhere else, the entire site get's invalidated. This is a setting for brochure-ware sites that don't change that often.

mikeytown2’s picture

Or set the cache lifetime to 52 weeks and rely on all the hooks to flush the cache when it's expired. Boost has a fairly high coverage rate for this; Only thing it doesn't cover is panels that contain multiple nodes, if you change a node then that panel won't be flushed. This can be overcome by setting panel pages to have a much lower cache lifetime; or by setting nodes to have a very high cache lifetime. Look into the Boost: Pages cache configuration block; allow you to set nodes to a very high cache lifetime while the rest of your site expires every 3 hours. Set the scope to node and set Maximum cache lifetime: & you should be good to go.

xn2001’s picture

@mikeytown2:
What constitutes a site changes?
Do the followings constitue a site changes:
-Some1 log in.
-Reports logging of Drupal
If they are then, can we narrow down to node level changes only?

mikeytown2’s picture

What constitutes a site change?

Timestamps in these tables:
* node_revisions
* files
* comments
* node
* node_comment_statistics
* votingapi_vote
This is for the Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron. setting.

So someone logging in or entries being entered into the watchdog table do not trigger this setting.

xn2001’s picture

Status: Active » Closed (fixed)

thx mikeytown2

Toxid’s picture

Wouldn't it be possible to just flush the cache file for the updated node? It seems pretty unessessary to flush the whole site if a node gets a new comment, for example. Unless there's some technical difficulties.

mikeytown2’s picture

@Toxid
Set a higher minimum cache lifetime to get what your requesting. Also keep an eye out for this #747788: Instant cache expiration: "Aggressive" page flushing

reynaldio’s picture

would "Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron." degrade server performance since it has to check the database for expired contents on cron run?

i get this info from my hosting provider that telling me that it cause php load to rise.

28521 23:13:38 poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
28521 23:13:38 write(7, "c\1\0\0\3UPDATE boost_cache_relation"..., 359) = 359
28521 23:13:38 read(7, "0\0\0\1\0\0\0\2\0\0\0(Rows matched: 0 Cha"..., 16384) = 52
28521 23:13:38 poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
28521 23:13:38 write(7, "]\1\0\0\3INSERT INTO boost_cache_rel"..., 353) = 353
28521 23:13:38 read(7, "\7\0\0\1\0\1\0\2\0\0\0", 16384) = 11
28521 23:13:38 poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
28521 23:13:38 write(7, "c\1\0\0\3UPDATE boost_cache_relation"..., 359) = 359
28521 23:13:38 read(7, "0\0\0\1\0\0\0\2\0\0\0(Rows matched: 0 Cha"..., 16384) = 52
28521 23:13:38 poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
28521 23:13:38 write(7, "]\1\0\0\3INSERT INTO boost_cache_rel"..., 353) = 353

Is that because i use "Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron."?

Thanks
Reynaldi

mikeytown2’s picture

@reynaldio
"Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron." is a simple query. What your experiencing is the views relationship builder getting out of hand. Disable all "Clear all cached views pages ..." and your site will return to normal. You now won't have the benefit of views getting expired on demand when their content changes though. #715450: Boost uses up every available MySQL connection without stopping is what your looking for.

looney_toons’s picture

mikeytown2
Somehow this "Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron." thingy does not work for me correctly.

I have the following options enabled:
- everything under "Boost File Cache" (cache lifetime - 1min for everything)
- everything under "Boost cacheability settings"
- under "Boost cache expiration/flush settings":
--- "Clear expired pages on cron runs"
--- "Check database timestamps for any site changes. Only if there has been a change will boost flush the expired content on cron."
--- "Clear all empty folders from cache."
--- "Flush all sites caches in this database (singe db, multisite)."
--- "Expire content in DB, do not flush file."
--- "Only Ignore Clear Entire Cache Commands (Recommended if caching css/js files)"
- under "Boost advanced settings":
--- "Aggressive setting of the boost cookie"
--- "Overwrite the cached file if it already exits"
--- "Aggressive Gzip: Deliver gzipped content independent of the request header."
- everything under "Boost crawler"

What I do:
1. Press the boost's "Reset Button" under admin.
2. Run cron.
3. Change the body of some node under some user & log out.
4. Wait until cache is expired & run cron.
5. Check the front page (which includes the view with this node), taxonomy term's page (which itself is a part of a menu & has this node) & the changed node itself.

Result:
- the front page cache has been updated (why?)
- the taxonomy term's page's cache has not been updated
- the changed node's cache has not been updated (!)

ressa’s picture

The only thing I changed after installing the latest dev version of Boost (6.x-1.x-dev - 2010-Dec-21) was setting "Boost - HTML - Default maximum cache lifetime" to 52 weeks. The front page is updated if a node which is shown in a block on the front page is added. Otherwise the Boost cached version is served. If a node is updated, the new version is served directly from server on first access, and then the Boost cached version.

In short, it seems to work as it should.