Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello
I'm using Boost module and Boost_Expiration module for expiration logic and httprl module too .
I set my Maximum lifetime to 3months and i'm checking the " Ignore a cache flush command if cron issued the request." and " Remove old cache files on cron." options .
I remarked that the cache files are flushed after each cron and regenerated afetr i visit the page .
Is there anyway to fix this probleme please .
Thank you very much
Comment | File | Size | Author |
---|---|---|---|
#10 | Schermafbeelding 2017-02-25 om 17.59.21.png | 41.7 KB | RAWDESK |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedFrequently this comes about because the Boost code is not in the .htaccess file correctly or there is a rewrite rule in the virtual hosting environment so that redirects everything to the index.php before the boost rules. Boost rules should be after rewrite base and before any other rules as otherwise the browser will hit index.php and then generate a file.
Comment #2
aminebourkadi CreditAttribution: aminebourkadi commentedhere is my htaccess file :
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedAnd therein lies the problem. In the boost .htaccess generation instructions it states
and your boost rules are out of place.
Comment #4
aminebourkadi CreditAttribution: aminebourkadi commentedSorry my english is not very good, should i uncomment those two lines or just one ?
and that?::
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedIt would be impossible for me to say 100% as I have no knowledge of your domain configuration but since your site is working then you should probably comment out the
RewriteBase /
line. This is basic drupal clean URL set up. Then the BOOST rules go after that line.
Comment #6
aminebourkadi CreditAttribution: aminebourkadi commentedthank you very much it works now
Comment #7
aminebourkadi CreditAttribution: aminebourkadi commentedit's work but i found another critical problem:
All the cache is flushed after each new node submit, i'm using the boost_expire module to manage boost cache changes
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedInstall boost_crawler, it's not a correct name, it regenerates only edited/ inserted/ deleted pages.
Comment #9
aminebourkadi CreditAttribution: aminebourkadi commentedboost_crawler is already installed, and i verifie it today many times, before i insert any node it was arround 1000 cached file, but after it goes !!
Comment #10
RAWDESK CreditAttribution: RAWDESK for Colruyt Group Services commentedI have a similar symptom as described in #7.
When an anonymous user (most of the time spam bot crawlers) are hitting node/add/blog, my whole static cache folder /cache/mydomain.com gets flushed.
This happens although a 401 is returned. So no actual content has been created yet !
Apparently triggered via a cron thread :
Having boost crawler enabled, as well as "Ignore a cache flush command if cron issued the request." and "Remove old cache files on cron."
Looking into the responsible piece of code of boost.module :
i am concluding that the first condition
lock_may_be_available('cron')
was met, since 'boost_ignore_flush' evaluates TRUE.Having little understanding of what this lock function actually evaluates in relation to boost cached nodes.
Obviously it is checking the existance and expire value of 'cron' in the semaphore table.
Sorry but this puzzles me, since i would expect some query instead evaluating the expiration of the cached nodes.
In my case the semaphore table is completely empty, returns true in the evaluation and flushes my static cache.
Wondering if the Ultimate cron installation might be conflicting with this evaluation, since boost might be expecting core cron settings and evalutions.
Comment #11
RAWDESK CreditAttribution: RAWDESK for Colruyt Group Services commentedReopend since no argumentation was added after now 2 similar symptoms, with boost crawler enabled.
Comment #12
RAWDESK CreditAttribution: RAWDESK for Colruyt Group Services commentedHonestly, i believe the check should look like this :
instead of :
It reflects what the comment above it actually says it should do in combination with lock, not or lock.
Comment #13
smitty CreditAttribution: smitty commentedSame problem here: All boost files are flushed, every time system corn is running.
The problem is that I don't know what lock_may_be_available('cron') and what it should deliver. In my case at least it delivers TRUE in every Case, no matter if cron is running or not. In my case, the semaphore table is completely empty, too.
So I doubt if lock_may_be_available('cron') checks to see if the flush was requested by the core cron like it is mentioned in the code.
I found out that there is a variable _cron_executing_job in the $GLOBALS telling if a cron is running. To be able to see, when boost cache is flushed without cron I added a message. So I came up with this code:
instead of:
Comment #14
Proteo CreditAttribution: Proteo as a volunteer commentedI just faced a similar problem and perhaps can provide some help for future visitors. I've had the same issue for months with one of the largest sites I manage. At first I thought it wasn't a big deal, until the site started to exhibit some performance issues. Administrators started to notice frequent slowdowns and after checking the watchdog I realized that the whole Boost cache was being flushed away every few minutes (sometimes, several thousand of perfectly valid entries were being deleted). I spent an entire morning trying to figure out why until I realized I was making an stupid mistake.
The site uses Ultimate cron to manage cron, which is invoked by a cron task every minute (as suggested). I was running the task like this:
* * * * * /usr/bin/drush cron -q
And that's the problem. What was happening, is that by invoking cron in that way every task in in the cron was being executed every time the cron was run, and caches were being flushed.
As per Ultimate cron's instructions, you should'nt invoke the cron in this way, but instead using something like this:
* * * * * /usr/bin/drush cron-run --uri=www.mysite.com --root=/var/www/public_html > /dev/null 2>&1
After making the change, everything worked as expected. I'll keep an eye on the watchdog for a couple of days, but after 4 or 5 hours things look great.
Comment #15
Proteo CreditAttribution: Proteo as a volunteer commentedQuick follow-up. Today, I noticed that the system cron task (which runs every 12 hours in the site) still flushed away the whole Boost cache. Still an improvement from before, but definitively not ideal. As it turns out, it's a know issue with Ultimate cron and the
lock_may_be_available()
function (as suggested above), but it's been fixed:https://www.drupal.org/project/boost/issues/1829832
After applying the patch in that thread the issue has been completely solved.