In the April 24th release of Boost 6.x-1.x-dev, Boost saves its cached files directly in /cache, rather than in cache/%{HTTP_HOST}, as it is configured in .htaccess. This is fine for my site, since I only have one domain, and I can rewrite the .htaccess rules accordingly, but this is probably not the intended behavior of the module.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | boost-446370.patch | 649 bytes | mikeytown2 |
| #12 | boost.install.patch | 1.57 KB | mikeytown2 |
| #9 | boost.install.patch | 353 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 commentedIf it saves it directly in the /cache dir then the static file will not be served unless you rewrite the rules. For clearing the cache it also might be problematic. Did you set the Cache file path: on the performance page?
If those are set correctly, can you run this in a php block and tell me what it gives you?
Comment #2
mikeytown2 commentedI should probably add a logic check to the boost.install file so it will throw an error on the status page if the boost_file_path variable isn't set correctly. I could have it throw other errors as well...
Comment #3
EvanDonovan commentedIt says that the path is "cache".
I didn't set the path as "cache/www.mysite.org" in the admin settings, because I assumed that the site name would be appended automatically. I guess that was the wrong assumption. Anyway, I rewrote the .htaccess rules so they work in my case. As for the cron, I'm running a cronjob every 6 hours that simply does an rm -rf *.* because it is faster than PHP and doesn't cause as much load.
A logic check on whether the path name was correct for the .htaccess rules would be great, as long as that isn't too difficult.
Thanks for taking the lead on this module's maintenance!
Comment #4
mikeytown2 commentedIt's supposed to default to "cache/www.example.com" if i remember correctly; www.example.com being your site.
NULL is seen as empty by php, so it should grab your host name from the $base_url variable.
http://www.php.net/empty
Did you follow step #7 in the install file? This won't matter since your clearing the cache dir with your own cron job.
http://drupal.org/node/367081#comment-1504894
Would you mind running this php code block for me?
Did you install & enable boost via cvs/command line?
Comment #5
EvanDonovan commentedboost_cache_directory() returns
/home/techmi5/public_html/gospelpedia/cache/www.gospelpedia.net. However, Boost saves the files directly in the cache directory.$base_url is set in settings.php to http://www.gospelpedia.net.
I enabled Boost in admin/build/modules.
Comment #6
mikeytown2 commentedI can't seem to find the reason why boost's boost_file_path variable got set to
cachein your case. The code that initializes that ishttp://api.drupal.org/api/function/variable_get
which then gets saved when you do a submit on the performance page because of this code
I can't give you a good answer as to why this happened to you. My only guess has to do with the $base_url, but that would only occur if this module was enabled via the command line.
Comment #7
EvanDonovan commentedOh, I think I know now why this happened.
The first time that I submitted the form the cache directory did not exist. (I was thinking I had it symlinked to the cache directory on my live site, which is still on D5.)
So then I created the cache directory, but I forgot to chown it to nobody.
I got an error message for that, and so I chown'd it. Then the module was working fine, except, like I said, it was saving to cache directly.
Some other modules (like XML Sitemap and Deadwood, I think) create directories they need automatically. Maybe that would be helpful here also?
Comment #8
EvanDonovan commentedWhen I ran
variable_set('boost_file_path', boost_cache_directory(NULL, FALSE));it set it to the proper value ofcache/www.gospelpedia.net. So I think my explanation above must be correct. (Something to do with how the form is validated, I imagine.)Comment #9
mikeytown2 commentedI think the easiest way to prevent this error in the future is to set that variable in the install file. Thus when the module is first installed, it gets set to
boost_cache_directory(NULL, FALSE).Comment #10
mikeytown2 commentedI need to throw an error in the status if it's set to
cache/.Comment #11
EvanDonovan commentedOk, great. Thanks.
Comment #12
mikeytown2 commentedpatch to check the cache dir
Comment #13
mikeytown2 commentedComment #14
mikeytown2 commentedcommitted
Comment #15
mikeytown2 commentedAfter clearing cache, if cache is empty upon viewing status page, boost will complain. This fixes that.
Comment #16
mikeytown2 commented