I can't get the tab
as i see boost is not reading files from cache, what can i do please?
I have a multilingual website
this is my .htacces settings
### BOOST START ###
AddDefaultCharset utf-8
FileETag MTime Size
Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
AddCharset utf-8 .html
AddCharset utf-8 .json
ForceType text/html
ForceType text/javascript
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTP:Pragma} no-cache [OR]
RewriteCond %{HTTP:Cache-Control} no-cache [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=2]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.json -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.json [L,T=text/javascript]
### BOOST END ###
thanks a lot
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedHave you tried %{HTTP_HOST} instead of %{SERVER_NAME}?
Did you place the htaccess rules in the correct spot of your
.htaccess
file?Are you logged out when checking for the tag?
Comment #2
madwalo CreditAttribution: madwalo commentedit is placed well, also on my pre-production site boost is working well, i've uninstalled and installed again and put this in .htacces
# RewriteBase /
### BOOST START ###
AddDefaultCharset utf-8
FileETag MTime Size
Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
AddCharset utf-8 .html
AddCharset utf-8 .css
AddCharset utf-8 .js
ForceType text/html
ForceType text/javascript
ForceType text/css
# NORMAL - Cached css & js files
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTP:Pragma} no-cache [OR]
RewriteCond %{HTTP:Cache-Control} no-cache [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=1]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
Comment #3
madwalo CreditAttribution: madwalo commentedi replaced with HTTP_HOST but still have the problem
Comment #4
torgosPizzaCheck permissions on the cache directories as well. I had this issue once, setting those correctly fixed it.
Comment #5
Jaypan CreditAttribution: Jaypan commentedI'm having the same issue. I have:
1) Checked the permissions on all folders
2) tried all three methods (%{HTTP_HOST}, %{SERVER_NAME} and domain name)
3) cleared the cache
4) confirmed I am definitely logged out (I have tried it in more than one browser other than the one I am logged in on).
5) confirmed that the code is in my .htaccess file (and I changed it each time I changed the method). Just to confirm, this is the .htaccess file in root right?
The thing is, even when I download cached code from the cache folder on the server, I don't see this code appended to the bottom of the html file. Is that correct?
Modules I'm using that my have something to do with this:
1) pathauto
2) pathredirect
Any ideas?
Comment #6
Jaypan CreditAttribution: Jaypan commentedFixed. It appears to have been a problem in Opera, as it works fine in Chrome and Safari.
Comment #7
iqbalbaskara CreditAttribution: iqbalbaskara commentedI have the same problem, well, similar. Only in my case, it's Firefox that's not showing the cached pages. tested it in chrome and IE the bottom tag showed up.
here's my .htaccess:
### BOOST START ###
AddDefaultCharset utf-8
FileETag All
Header set Expires "Sun, 19 Nov 2100 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
AddCharset utf-8 .html
ForceType text/html
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTP:Pragma} no-cache [OR]
RewriteCond %{HTTP:Cache-Control} no-cache [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=1]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
Here's what I tried already:
If you have any idea what i should do, please share it with me :) thanks in advance.
My site is at http://games.oraystudios.com
Comment #8
talatnat CreditAttribution: talatnat commentedI confirm this -- the page shows Boost tag at the bottom for Chrome, but not in Firefox 3.6.2.
Like iqbalbaskara, I tried all possible options to get Boost working (while using Firefox, my main development browser), before coming across this post and checking the page with Chrome.
Some additional info: I first set up Boost to run on a staging server using shared hosting, and it worked even with Firefox (the ISP required %Server_Name and actual path document root, not %Document_Root). The main site (a mirror of the staging server) runs on a private Apache instance and a dedicated phpstack. This is the first time I am noticing any difference between the two sites' behavior. The httpd.conf of the main site has DocumentRoot defined, so it runs on either %Document root or actual path.
In googling, I find that modern browsers interpret rewrite rules in different ways (some keep directory structures intact when changing domains), but I have not found anything specific that may apply to this case.
Add: It works in Firefox 3.6.3 (Win 7), IE 6-8 (Win 7), Opera (Linux, Win7). The problem seems to be just Firefox Linux.
Add#2: It works from another computer using Firefox Linux, so it appears to be a specific browser setting/add-on.
Fixed (for me): It turned out that there was a duplicate cookie for DRUPAL_UID stored as as lowercase drupal_uid in Firefox. So even after logging out, the cookie validated the user as authenticated to Boost, and it was not serving up cached pages. Unfortunately, upgrading Firefox and also checking on a separate machine -- both imported Bookmarks, Preferences (and these drupal_uid cookies) from the older Firefox version -- just kept the problem recurring!
Clearing all the cookies for that Drupal site fixed the problem. I can view pages cached by Boost in Firefox Linux.
I am not quite sure how this browser ended up with two cookies, nor whether there is some security implication here.
Comment #9
Oscar Illada CreditAttribution: Oscar Illada commentedi am getting the same issues, i am working on a live site, what can i do, or how a know if the module works fine.
Thanx
Comment #10
torgosPizzaDid you check Watchdog? Make sure PHP isn't throwing errors, as this will cause pages to not be cached by Boost. Check your Boost settings as well to see if this is the case.
Comment #11
Oscar Illada CreditAttribution: Oscar Illada commentedI am working with aegir, i try in the local and it works with out aegir. I look in the watchdog and there is no php error, any help please
Comment #12
Oscar Illada CreditAttribution: Oscar Illada commentedI solved the problem, for any one who have the same issue the solution if you are working with aegir, after you put the htaccess boost rules then go to your aegir site and put verify in the platform you are working on.
Comment #13
torgosPizzaInteresting, good to know.
Comment #14
Jaypan CreditAttribution: Jaypan commentedI'm thinking that maybe firefox removes comments after the closing HTML tag. I can see that my pages are being cached on Opera, but not FF, even after clearing all my FF cookies.
Comment #15
torgosPizzaAnything in Watchdog? Is PHP throwing errors for you? You're sure you aren't logged in in FF, right? (FWIW I can see the comments in all of my browsers.)
Also make sure you're on the same page in both browsers. Sometimes you need to refresh once or twice if the page isn't cached yet.
Comment #16
Jaypan CreditAttribution: Jaypan commentedDefinitely not logged in. No errors in my watchdog. But no boost comment at the bottom of the page! Same page in both browsers.
Comment #17
Jaypan CreditAttribution: Jaypan commentedHere's the (or a) site: http://www.jlpt-study.com/
I'm using firefox 3.6.6. Let me know if you can see the boost comments at the bottom.
Comment #18
mikeytown2 CreditAttribution: mikeytown2 commentedI see the tags; FF 3.6
Comment #19
Jaypan CreditAttribution: Jaypan commentedThanks, that helps track down the error then - it must be something specific to my computer. I'll have to dig through and figure out what it is. I'm definitely signed out - I cleared all cookies related to the site. But at least it helps narrow down the possibilities.
Comment #20
gaurnar CreditAttribution: gaurnar commentedI have that kind of problem too. Except that I'm seeing it in all browsers on my computer (FF 3.5.10, IE 8.0.6700, Chrome 5.0.375). The strange thing is that I can see the tag on front page, but nowhere else. I can see cache files created by Boost on the server, but browser seems to load uncached version. The Boost's page cache status block also shows that the page is cached.
Comment #21
gaurnar CreditAttribution: gaurnar commentedI got it! Though it doesn't look much like madwalo's or Jay's case, but it would be a warning for others to be more carefully when reading Boost handbook. I didn't read the installation part carefully, and inserted Boost .htaccess code IN THE END of the file. But it should be BETWEEN
# RewriteBase /
and# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
lines. That was the cause of my problems.So far I have no problems with Boost.
Comment #22
Jumoke CreditAttribution: Jumoke commentedI have been hacking away at this problem all day and i am exhausted. I have tried anything!! i get nothing. I see the pages created, my status reads that it's fine yet i don't get the cached pages to display.... : (
Comment #23
bbeyer CreditAttribution: bbeyer commentedFYI, the best way to check is to use curl. The browsers do various things when viewing source. Some cutoff code below the closing html tag so you don't see it even though it is rendered.
Comment #24
Aibu CreditAttribution: Aibu commentedHi Excalibur,
on my installation, I found out that if Drupal is on a subfolder, and you set $base_url on your settings.php, the system fails to serve cached pages.
I don't know if this is your case, but possibly this can give you some inspiration.
P.S. I haven't managed to solve the problem yet.
Comment #25
terryzwt CreditAttribution: terryzwt commentedI have the same problem. In the local test, all things go well. there is "page cached by boost" at the bottom of the source file.
When I upload the site to webhosting, cache files were generated, but without "page cached by boost" at the bottom.
Comment #26
Jaypan CreditAttribution: Jaypan commentedI wonder if some browsers don't cut off comments after the closing html tag. Maybe it would be best to add this tag before the closing html tag.
Comment #27
bmango CreditAttribution: bmango commentedI was having the same problem. I managed to solve it by replacing
%{DOCUMENT_ROOT}
in the .htaccess file with the actual root path on my server.Comment #28
torgosPizza@bmango: That sounds like a server config issue. If you ever replace your current Drupal install with a new version of core, .htaccess will be overwritten. (Of course you should always keep a backup of the current .htaccess in the docroot anyway.) But that's an interesting tip - the cause (server config) may help others in this situation get closer to a fix.
Comment #29
elshae CreditAttribution: elshae commentedI am having this issue. In my case my files are being cached accordingly, but they are never served, hence I never see this comment at the end of my pages. I've been on the IRC and I am still at a standstill. Suggestions have pointed me to my .htaccess file. Is there any other config in .htaccess that can break Boost? I am adding the link to my .htaccess settings below. Please help if you can, I have even uninstalled and started from scratch with the default settings, but no luck there either.
http://pastebin.com/DxaM6UHF
Comment #30
torgosPizzaThe issue is most likely not Boost, but the conditions with which you have Boost pages being served. Double-check your settings in the Boost UI; perhaps you should start with fewer options at the beginning. This is the best way to troubleshoot such an issue, in my opinion.
Alternatively, if you can post a link to your site so we can take a look, that might also be helpful.
Comment #31
elshae CreditAttribution: elshae commentedMy site is not live so unfortunately I can't provide a link. I am not sure I will be able to detect what could be wrong with the "Way" the pages are being served, but I definitely try and give the UI a look. If anyone else can offer me suggestions, please. I am out of ideas and I am about to disable Boost as I cannot get it working...
Comment #32
elshae CreditAttribution: elshae commentedI don't know if this could help but some facts are:
We are using https not http
cms instead of www
I can access the cached files from the URL, the only problem I see is that they are never the one that is being served to the user.
I really want to use Boost but I have no idea what's wrong...
Comment #33
torgosPizzaSo, again, the issue is that the .htaccess file is not serving the static files. You need to start changing your options, and rewriting the .htaccess file (you can do this in the UI) and work back to where you want to be.
Start with as few rules as possible, and then start adding more. There has to be a reason why these pages aren't getting served and the first place to look is in how the htaccess file is checking.
You're of course not logged-in, right?
Comment #34
elshae CreditAttribution: elshae commentedSigh still nothing. I have tried your suggestions, along with those of replacing %{SERVER_NAME} with %{HTTP_HOST} etc and have verified those are not the problems. The files are being created in the proper directories and the paths are fine. I am logged out and still nothing :/. In the first version I installed I hacked it to work for logged in users and again the files were created, but never served. I am attaching the boost portion of the .htaccess file. I am grateful for your help and I apologize for a late reply.
Thank you,
elshae
### BOOST START ###
AddDefaultCharset utf-8
Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
AddCharset utf-8 .html
AddCharset utf-8 .css
AddCharset utf-8 .js
AddEncoding gzip .gz
ForceType text/html
ForceType text/javascript
ForceType text/css
# Gzip Cookie Test
RewriteRule boost-gzip-cookie-test\.html cache/perm/boost-gzip-cookie-test\.html\.gz [L,T=text/html]
# GZIP - Cached css & js files
RewriteCond %{HTTP_COOKIE} !(boost-gzip)
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=2]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
# NORMAL - Cached css & js files
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTP:Pragma} no-cache [OR]
RewriteCond %{HTTP:Cache-Control} no-cache [OR]
RewriteCond %{HTTPS} on
RewriteRule .* - [S=3]
# GZIP
RewriteCond %{HTTP_COOKIE} !(boost-gzip)
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
Comment #35
torgosPizzaWell, keep in mind Boost is not meant to work for logged-in users. It's for anonymous visitors only.
Secondly, is your .htaccess even being acknowledged? If you're using Clean URLs then the answer is yes, but you can check and make sure by putting in some garbage text into it - and if your site White Screens (WSOD) then you'll know it's being accepted and parsed by Apache.
If .htaccess is being acknowledged but Boost pages are still not being served, it has to be either .htaccess or perhaps an Apache directive. Unfortunately at that point it's no longer a Boost issue but a support request, and potentially one that's out of scope since that could be server related. But it's hard to know without having direct access to your server.
Sorry I can't help any further, I know it's frustrating but there is always a fix. Just have to keep digging...
Comment #36
elshae CreditAttribution: elshae commentedThank you so much for your replies. If I find anything out, I will get back to you and post my findings here.
Comment #37
drupalfever CreditAttribution: drupalfever commentedTwo other basic things that you should check before going crazy.
* Do you have Clear URLs enabled?
Boost caches pages that have their URLs stored on the "url_alias" table. If Clear URLs is disabled, the
pages are going to have URLs with the "?q=" characters. This will make the current page have a different
URL than the URL stored on the "url_alias" table. Boost will not serve the page because it thinks that it
is a different page.
* Did you add any line-breaks before or after the lines you added into your ".htaccess" file?
Apache doesn't like unnecessary spaces and line-breaks on the ".htaccess" file. Remove any unnecessary
line-breaks from the Boost code that you are inserting into the ".htaccess" file and you should be fine.
Comment #40
Jaypan CreditAttribution: Jaypan commentedSpam?
Comment #41
torgosPizzaApparently. I'm not going to download those files to find out :P
Comment #42
elshae CreditAttribution: elshae commentedI have started working on this again and still I cannot get it to work :(.
@torgosPizza - You said "it has to be either .htaccess or perhaps an Apache directive."
I don't think it's the .htaccess. As it seems to be read. If I remove the .htaccess, my site breaks down so that's how I know it's being acknowledged. I have also verified that the variables
$_SERVER['DOCUMENT_ROOT']
$_SERVER['HTTP_HOST']
$_SERVER['REQUEST_URI']
$_SERVER['SERVER_NAME'];
yield the correct results. What did you mean by "Apache directive"?
@drupalfever
I have clean URLs working just fine and I have tried the suggestion of removing line-breaks. If I remove all line breaks in the .htaccess, I get an error. If I remove it just from the Boost code the file works but nothing changes with Boost...
Any other ideas?
Comment #47
elshae CreditAttribution: elshae commentedI just wanted to thank you guys for all your help and suggestions. I finally figured out why Boost was not working for me. Turns out using https was a no-no as it is seen as an authenticated connection (Duh!) :p
All I had to do was switch the flag RewriteCond %{HTTPS} on to off, see below (comments surround the flag):
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{HTTP:Pragma} no-cache [OR]
RewriteCond %{HTTP:Cache-Control} no-cache [OR]
#Flag changed from on to off to serve cache page to https -Elisa
RewriteCond %{HTTPS} off
#Flag changed from on to off to serve cache page to https -Elisa
RewriteRule .* - [S=7]
Hope this helps someone else in the future!
Cheers,
elshae
Comment #48
torgosPizzaThat would do it. Glad you got it figured out! Setting this issue to fixed.
EDIT: I'm wondering if parts of this Issue should be turned into a FAQ / book page for the Boost module. Seems there are probably others who could use this info.
Comment #52
suganyaM CreditAttribution: suganyaM commentedDisable "Follow RFC2616 14.9.4" in the admin/settings/performance/boost. This will make all the browser to get the cached page from boost.
Enabling the above setting, will bypass the boost cache when the headers contain a "no-cache" cache-control directive (ctrl-F5 in browser). Disabling this will make boost always serve pages from the cache.
Since most browsers will send no-cache value for the cache-control directive in the request header, disabling this is a good workout.
Comment #53
federico CreditAttribution: federico commentedHi,
I've been trying for days to get Boost to serve pages.
Finally, I copied the boost rules in apache2.conf under
and it's working now.
My apache version is Apache/2.2.22 (Ubuntu)
I hope this helps someone.