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

CommentFileSizeAuthor
mo.zip68 bytesterryzwt
zero.zip68 bytesterryzwt
uber.zip68 bytesterryzwt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Title: Not showing tab <!-- Page cached by Boost @ 2009-08-11 06:19:58, expires @ 2009-08-11 09:19:58 --> » Not showing "Page cached by Boost" at bottom of html
Category: task » feature

Have 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?

madwalo’s picture

it 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'.

madwalo’s picture

i replaced with HTTP_HOST but still have the problem

torgosPizza’s picture

Check permissions on the cache directories as well. I had this issue once, setting those correctly fixed it.

Jaypan’s picture

I'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?

Jaypan’s picture

Fixed. It appears to have been a problem in Opera, as it works fine in Chrome and Safari.

iqbalbaskara’s picture

I 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:

  1. uninstalling and reinstalling boost module
  2. %{HTTP_HOST} instead of %{SERVER_NAME}
  3. flushing the caches
  4. erasing the cache folder
  5. ensuring CHMOD to cache folder and its subfolders is 755

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

talatnat’s picture

I 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.

Oscar Illada’s picture

i 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

torgosPizza’s picture

Did 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.

Oscar Illada’s picture

I 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

Oscar Illada’s picture

I 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.

torgosPizza’s picture

Interesting, good to know.

Jaypan’s picture

I'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.

torgosPizza’s picture

Anything 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.

Jaypan’s picture

Definitely not logged in. No errors in my watchdog. But no boost comment at the bottom of the page! Same page in both browsers.

Jaypan’s picture

Here'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.

mikeytown2’s picture

I see the tags; FF 3.6

Jaypan’s picture

Thanks, 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.

gaurnar’s picture

I 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.

gaurnar’s picture

I 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.

Jumoke’s picture

I 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.... : (

bbeyer’s picture

FYI, 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.

Aibu’s picture

Hi 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.

terryzwt’s picture

I 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.

Jaypan’s picture

I 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.

bmango’s picture

I 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.

torgosPizza’s picture

@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.

elshae’s picture

I 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

torgosPizza’s picture

The 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.

elshae’s picture

My 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...

elshae’s picture

I 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...

torgosPizza’s picture

So, 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?

elshae’s picture

Sigh 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 ###

torgosPizza’s picture

Well, 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...

elshae’s picture

Thank you so much for your replies. If I find anything out, I will get back to you and post my findings here.

drupalfever’s picture

Two 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.

Jaypan’s picture

Spam?

torgosPizza’s picture

Apparently. I'm not going to download those files to find out :P

elshae’s picture

I 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?

elshae’s picture

I 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

torgosPizza’s picture

Status: Active » Fixed

That 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.

Status: Fixed » Closed (fixed)

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

suganyaM’s picture

Disable "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.

federico’s picture

Hi,

I've been trying for days to get Boost to serve pages.

Finally, I copied the boost rules in apache2.conf under

Directory /var/www

and it's working now.

My apache version is Apache/2.2.22 (Ubuntu)

I hope this helps someone.