Hi. I'm using Boost on a high-traffic site and it's fantastic. I've been reading the documentation and there's something important I don't understand: When you update a page, does boost clear that page from the html page cache? One poster claimed that boost_nodeapi does that, but it doesn't on my server. Is there some way I'm supposed to hook it up?
If there isn't and I have to run cron, will cron clear out all my pages or just "stale" ones (one of the posts I've read implies that cron just cleans up stale pages). Any help would be most appreciated!
Thanks!

CommentFileSizeAuthor
#25 boost-459530.patch1.02 KBmikeytown2
#14 boost-459530.patch526 bytesmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dracolyte’s picture

Hah! just figured it out. In the boost_nodeapi function, the call to expire the cache only works with pages called "node/NN". Like so: boost_cache_expire('node/' . $node->nid, TRUE); However, my page is called "about_us/our_mission" and so the cache_expire code doesn't delete the html. So it would seem to me that all that is needed is a more flexible param with the actual [nodename].html passed to it.

geerlingguy’s picture

Project: Drupal core » Boost
Version: 6.x-dev » 6.x-1.13
Component: node.module » Caching logic

Retagging so it's in the proper queue.

geerlingguy’s picture

Title: Boost not clearing updated pages from cache » Boost not clearing updated (or any!) pages from cache

I'm having the same kind of problem - I have boost enabled on www.lifeisaprayer.com, and I've entered the site URL into the settings.php file, and set cron to run every 25 minutes (it's verified working), yet boost won't ever clear its cache unless I go to the boost configuration page...

Kars-T’s picture

Status: Active » Needs work

Same problem here.

I did some debugging on this.

define('BOOST_LOOPBACK_BYPASS',      BOOST_OVERWRITE_FILE && BOOST_CRAWL_ON_CRON ? variable_get('boost_loopback_bypass', FALSE) : TRUE);

Only if both BOOST_OVERWRITE_FILE && BOOST_CRAWL_ON_CRON are TRUE the variable gets evaluated. And only if its FALSE the cron will do anything.

In my setup the "boost_overwrite_file" was FALSE so this gets evaluated to TRUE and the cron does not expire anything.

I am not deep into this module and hope I don't mix up any variable names but there seems to be some sort of logical problem here.

Cynthia Ewer’s picture

Subscribing. Same problem at multisite installs http://organizedchristmas.com and http://organizedhome.com

mikeytown2’s picture

Sounds like we might have 3 different issues here; but who knows, maybe its all the same issue.

Going off of what Kars-T mentioned, I should put the Expire content in DB, do not flush file. (BOOST_EXPIRE_NO_FLUSH) setting inside the crawler block, so it is disabled unless you turn on the crawler. There are too many options, one can easily shoot them selfs in the foot right now. I need to make the configuration simpler.

@organizedhome
Depending on how your server is setup, you might have to have 2 separate cron runs, one for each site, so organizedchristmas.com/cron.php & organizedhome.com/cron.php. If your running off of one database turn on this setting "Flush all sites caches in this database (singe db, multisite)."

@geerlingguy
Original poster is from May, boost is way different... anyway your issue probably got fixed in this issue #617826: Assignment instead of comparison in boost_cache_expire_derivative(). Try the dev version and let me know if it works.

Cynthia Ewer’s picture

Mikeytown, thanks.

I know this is complex. I have multi-sites running off of one code base, and one of them is running the Domain Access module. All have separate databases.

Will try any solution you suggest OR do it manually, because you're saving my Housewife Webmaster bacon right now with this module. 3 days ago, we were drowning.

mikeytown2’s picture

@organizedhome
If you have separate databases for each site then you need to call cron for each site.
organizedchristmas.com/cron.php
organizedhome.com/cron.php
If you have the crawler turned on you might want to run cron at alternating times on your server, or turn the threads down, or set the crawler throttle.

Glad to hear that Boost is working for you guys :)

geerlingguy’s picture

I will try dev on lifeisaprayer.com as soon as I get back to the states and can upload it. Even without flushing the cache, it's helping the server run a lot better. It helped the St. Louis Review immensely as well, and I'm going to be deploying it on a much larger website sooner or later...

mikeytown2’s picture

@geerlingguy
The rate of change for boost has increased this last month, with the new cache expiration for views in place, a lot of code refactoring has taken place to take full advantage of the new functionality. As such some things have been broken, but the changes coming out the other end is pretty awesome. Here's all the patches that went in (Green), in the last 10 days
http://drupal.org/node/575840#comment-2174220. I hope to get 1.14 out the door next week.

W.M.’s picture

Same here: Boost doesn't flush expired cached files... Visitors get served the old expired pages (that's unless I clear them from Boost settings page).

mikeytown2’s picture

@Geir19
Try the latest dev, let me know if that fixes the issue for you

Kars-T’s picture

Just to mention: I waited to see if the watchdog notice "Expired stale files from static page cache." was set. But boost_cache_expire_all() will always return false so we never get this message for log level 5.

mikeytown2’s picture

Status: Needs work » Needs review
FileSize
526 bytes

thanks Kars-T for pointing that out!

W.M.’s picture

So mikeytown2 what should I do?! The patch or the dev version?!

mikeytown2’s picture

@Geir19
Patch fixes the watchdog error, dev might fix your problem. Use the latest dev.

Cynthia Ewer’s picture

To clarify, the sites have shared code as multisites, separate databases, separate cache directories, and separate cron runs. One site has subdomains enabled via the Domain Access module, so each such subdomain has a cache directory, as well, but they do share a database. I have not yet enabled the crawler.

All sites are perfect candidates for Boost: 99.99% of traffic is anonymous.

Problem is that none of the site or subdomain caches are being flushed on their respective cron runs. Works beautifully if I do it manually, but we run a lot of scheduled content, so that can be tricky.

I will try the dev version to see if this fixes the problem--but again, thank you! Server load earlier in the week was exceeding capacity and crashing databases; with Boost onboard, load levels dropped by 90% and the sites are flying. Where's your donate button?

Cynthia

mikeytown2’s picture

@organizedhome
Donate link is at the bottom of the release: http://drupal.org/node/610194

Go ahead and give the latests dev a shot. Let me know if it does or doesn't work.

W.M.’s picture

I will be back here and update as time passes by and pages expire!

mikeytown2’s picture

Status: Needs review » Active

committed #14. Will not fix the issues in the thread.

geerlingguy’s picture

I just installed the latest 6.x-1.x-dev release of Boost, ran cron a few times (after running update.php), and still didn't have any less expired pages flushed. I will let it run for a couple days and see if Boost starts flushing the pages, but I have a feeling that won't happen :-(

We shall see...

mikeytown2’s picture

@geerlingguy
Can I get a screenshot of your configuration page? Use something like this to take the screenshot: https://addons.mozilla.org/en-US/firefox/addon/3408

jbrauer’s picture

Haven't tested this yet but it looks like this is the case... If the crawler is off BOOST_LOOPBACK_BYPASS is forced to TRUE. This in turn causes boost_cron to stop at the beginning of this line

  if (!BOOST_LOOPBACK_BYPASS && variable_get('boost_expire_cron', TRUE) && $expire && boost_cache_expire_all()) {
jbrauer’s picture

Status: Active » Needs work

Tested this with the crude workaround of just removing that part of the test from line 374 of boost.module and it works. It now reads:

  if (variable_get('boost_expire_cron', TRUE) && $expire && boost_cache_expire_all()) {

It seems like a little more elegant fix would be to make BOOST_LOOPBACK_BYPASS default to FALSE if BOOST_OVERWRITE_FILE and BOOST_CRAWL_ON_CRON aren't both set. So instead line 85 would become:

define('BOOST_LOOPBACK_BYPASS',      BOOST_OVERWRITE_FILE && BOOST_CRAWL_ON_CRON ? variable_get('boost_loopback_bypass', FALSE) : FALSE);

I'm not sure, however, what other ramifications that might have elsewhere...

mikeytown2’s picture

Title: Boost not clearing updated (or any!) pages from cache » Define Assignment Error - Boost not clearing updated (or any!) pages from cache on cron.
Status: Needs work » Needs review
FileSize
1.02 KB

@jbrauer
I think thats it, It should have always been FALSE; Also thanks to Kars-T for pointing it out at the beginning of this thread.

mikeytown2’s picture

Priority: Normal » Critical
mikeytown2’s picture

Status: Needs review » Fixed

committed

geerlingguy’s picture

Awesome! Are you still planning on pushing 6.x-1.14 in the next week or so? If that's the case, I'll just hold off until then. Thanks again (like others have said) for one of the most awesome Drupal modules in existence (in my opinion!).

mikeytown2’s picture

1.14 will be pushed out once I hear back on the status of this patch, if it fixes a long standing bug or not. I expect it to be out early November.
#305071: user logout, Header unset ETag & browser caching front page

For an overview of where this is headed and what will be in 1.14 (what you already have with the latest dev) this is the thread for you
http://drupal.org/node/575840#comment-2174220

W.M.’s picture

mikeytown2: Thanks for great work.. I realized how much code goes into this as I applied the patch.. I applied the recent patch on the latest dev version and problem solved! I can confirm that.

I have one question regarding the settings under /admin/settings/performance (that come with Drupal), should caching be set to off there?! I think this needs better documentation in Boost..

I have also discovered that running cron using "domainhere.com/cron.php" results in cron running fine but results also in a "page not found" error/page (instead of a blank white page - as it did before). I am not sure if this is related to Boost ?!

mikeytown2’s picture

@Geir19
That could be related to this recently fixed bug if your running the latest dev.
#619934: CRON generates a "Page not Found" error...

You can set the cache to whatever you like... if boost will not cache it, then core might be able to. so enabling both is perfectly fine, they will not conflict. It all depends on what you want the cache to do... lots of options. I personally don't run with the core cache on.

Cynthia Ewer’s picture

Whoo-HOO!

The latest fix did the job. All caches duly cleared on cron run after installing the Nov. 1 .dev version.

Thank you SO much, Mikeytown. This is a fantastic module. Off to show some gratitude.

Cynthia

mikeytown2’s picture

@organizedhome
Thanks for your support!

tntclaus’s picture

Status: Fixed » Active

It seems I have the same issue. Installing 1.14 didn't help. I've set html cache 15 min. Cron runs every 20 minutes, but expired cache doesn' flush :( The cached pages stay at their folder (cache/normal/sitename/), the number of expired cache pages at admin/settings/perfomance/boost doesn't reduce etc.

tntclaus’s picture

Status: Active » Fixed

I dunno what I did, but now it works.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.