1. Goto: [Administer > Configuration > Search and metadata > Clean URLs] and ensure that Drupal's clean URLs are enabled and working correctly on your site.
2. Unzip and upload the module folder (as is) to the sites/all/modules folder in your Drupal installation directory. Enable the module.
3. Goto: [Administer > Configuration > Development > Performance] and disable the Drupal core cache for anonymous users. Boost will not be able to generate its cache if a page is already in the Drupal core cache. This is the only core setting you must disable, others can be left enabled.
4. Goto: [Administer > Configuration > System > Boost > Boost Settings] and review the default settings.
5. Goto: [Administer > Configuration > System > Boost > File System] Make sure that the cache directory is writeable by the web server: you may need to create the directory, and set the permissions. Ideally, the cache directory should be owned by your user and be in the group of your web server ("www-data" on Debian/Ubuntu), with a unix permission of 775 (read/write/exec owner, read/write/exec group, read/exec others).
To check these goto: [Reports -> Status Report]
6. Review the other default Boost settings.
7. IMPORTANT - Back up the original .htaccess file from your Drupal installation directory for safe keeping. In the next step you will edit this file and any mistake may render the site unusable (e.g. 500 Server Error, 404 Not Found etc.)
8. REQUIRED - This step is easy and required for Boost to work! Copy the custom generated htaccess rule from the [Administer > Configuration > System > Boost > .htaccess > .htaccess Generation] page and paste the rules into the Drupal .htaccess file as shown below.
# RewriteBase /
-------paste the rules right here--------
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
Note: If you get "400 Bad Request" responses from Apache server, make sure you have configured the RewriteBase. For example when using VirtualHost configurations it is necessary to define as:
RewriteBase /
The final outcome should be this:
# RewriteBase /
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# 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 %{HTTPS} on [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=3]
# GZIP
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html,E=no-gzip:1]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
8. a. IMPORTANT - Note for Windows Users only ...
When you copy the code from the ".htaccess generation" page (admin/config/system/boost/htaccess/generator), you MUST paste it into an editor that will convert the line endings to LF. This problem had me chasing shadows for a good long time. It's likely to occur if you develop on the windows platform but will have your Staging/Production servers on a Linux environment.
Use Notepad++ (free software) to double check the line endings of the .htaccess code you copy. You can do this (once you've installed Notepad++) by making a new document, pasting the .htaccess code into it and going to and clicking on View > Show Symbol > Show End of Line. This will show you whether or not the end-of-line (EOL) characterr is CRLF or LF.
By default, Notepad++ will set the EOL to be the system default - which is CRLF on Windows. You may convert the line endings in the document by going to and clicking on Edit > EOL Conversion > UNIX Format. The character-figure at the end of lines will change from "CRLF" to "LF". Once this is done, it is safe to re-copy the .htaccess code and THEN put that into your .htaccess file.
Line endings and development across systems can be a pain, when working from a Windows machine, always keep it in the back of your mind.
9. Done! Enjoy your boosted Drupal!
10. Optional - enable crawler submodule to pre-cache pages.
Comments
Directory
If my site is vinnchan.net, then the directory should be cache/normal/vinnchan.net and should set the cache folder to 0775 permission ?
If it is above case, so I should keep Root cache directory : cache and Normal cache directory : normal?
Thanks for help
Correct
Yes, that's what I did. And actually, not sure if it's my host or Drupal or Boost or what did it, but I just checked the settings, hit save, checked my directories, and they were already created and with correct permissions.
Thanks!
This module helped a lot - thank you!
I lost my session
I follow every step that I read in README.txt for Drupal 7 and every thing looks fine, but when I click over my site logo or other link I lost my session. What was my mistake? . Thank you for your help...
re: I lost my session
Try the latest beta2 (or dev version). If I understand correctly what you describe, it may be fixed already. Please open a support request in the project's issue queue if the problem persists.
cache directory clarification
The 'file system' page instructions are a little unclear. It says to let them default. That is correct. Just leave them alone: Root cache directory = 'cache'. Normal cache directory = 'normal'. You don't have to change the settings to 'cache/normal/www.example.com' as you might infer.
re: cache directory clarification
Thanks for the feedback. I changed the formulation a bit to make it a bit clearer.
Great Module!
I was averaging 8-10 second page loads. I followed this guide exactly (which is one of the clearest guides i have seen on Drupal) and instantly my page loads, when logged out and no admin menu, is about 3-4 seconds.
I do have some questions:
1. Since the page info is stored as a gzipped html and not accessing my database as much does this mean my my monthly VPS MB limit can be reduced? i have a limit of 300mb and my database VPS crashes at least once a day. I ask because as a new business i am broke and want to try and minimize costs as much as possible.
2. how does this work with a responsive theme for mobile?
3. It seems that page load is still very slow as a logged in user. Anonymous user is at about 3 seconds page load now. Did i do something wrong in my setup of Boost?
thanks in advance for the info!
Caching
I'm not a Boost expert but I'll try and answer as I understand it.
1 - The pages are generated, compressed and stored when they are first accessed. Subsequently those pages are loaded directly from the cache, reducing the server load. Since the server is no longer generating content, but just sending the cache file again, the VPS processor and memory load will be massively reduced. I think the built in Drupal caching already gzips output, so the actual bandwidth used, in MB, won't be significantly reduced, if at all.
2 - The page generated is just copied to a file and compressed. Since a responsive theme is just a normal HTML page with media queries that are interpreted by the client browser, it will exactly as before.
3 - It's my understanding that this module only works if the system can guarantee that the page won't change between loads. With user specific content this is not the case so this module only really works for anonymous users.
I hope that makes things a little clearer and that if I'm wrong on anything, somebody more familiar with Boost will clarify.
http://www.darksnow.net
How is the cache directory setup for multi site
I have a vhost configuration. The multisite is setup as follows
/home/potliweb/
Site 1 - /home/potliweb/sites/potli.sastratechnologies.biz
Site 2 - /home/potliweb/sites/potlim.sastratechnologies.biz
So where should the cache directories be created in /home/potliweb or in the respective site directories. Documentation is not clear on this. It just says that Boost supports multisite setup.
Also how do I check if Boost is working. In Drupal 6, Boost used to append its signature at the bottom of the page when the page is cached. Does the same apply in D7?
Acer Aspire 5745
[i5 430M, 3GB, 320GB]
Ubuntu 12.04 (Precise Pangolin)
Drupal 6.15, 7.x
DigitalOcean, Go Daddy, Rackspace,
Boost is not serving Cached pages
Hi, I installed Boost as per the instructions, and I was able to see the files being cached in the path mentioned. I did not see any improvement in the page loads, so I did some troubleshooting and found out that the files are not being served from cache. Each time the link is refreshed, a new file is being created/modified in the cache directory. I am using the latest version of Boost and 2.4 Apache. Can anyone please help out if you faced a similar issue before? Thanks for your help !!!!
Which version of Drupal
Which version of Drupal are you using?
Acer Aspire 5745
[i5 430M, 3GB, 320GB]
Ubuntu 12.04 (Precise Pangolin)
Drupal 6.15, 7.x
DigitalOcean, Go Daddy, Rackspace,
I have the same problem, but ..
I had the same problem. I use boost 7.x-1.0-beta2 and drupal 7.18.
It is solved if I enable the "Cache pages for anonymous users" in admin/config/development/performance. This is diffierent from the description in "Boost 7.x: installation instructions" (http://drupal.org/node/1459690).
BUT I have new problem: the "Cache Lifetime" dosen't work (can not be controlled). For example, I set the Cache Lifetime for 1 week, but a new file is being re-created/modified in the cache directory AFTER some hours. I don't know why. Where can I set it ?
Did you fixed it?
Hi Wanneng... I'm having the same issue at a vps server, the caching is generated/updated everytime, but can't get the site to serve cached pages.
Where you able to fix your problem? How did you do it? Thanks,
Subfolder
If you have your website setup in a subfolder, it is important to note that step 8, pasting the htaccess code, is NOT correct. If your site is in a subfolder, and you use a htaccess in the root to obscure that drupal is in a subdirectory, then you have to put the boost htaccess rules in the root's htaccess, not the htaccess in the drupal folder. Here's what I did to have Drupal in a subfolder and have boost working:
Hope this helps someone, this took me a couple of hours to debug.
Dagomar Paulides
B.A. Digital Media Design
Partner @ Online Agency
Subfolder
This solution worked for me. Thanks!
The only thing I had to make sure was that the document root in the boost .htaccess settings pointed to the physical path of the drupal installation rather than %{DOCUMENT_ROOT}.
Boost
Thanks a lot your post help me lot and save me lots of time
:)
thanks great job
Thank you dagomar!
This solution worked for me in speeding-up my site in a shared-hosting environment. Kudos!
Caching Files Works, Serving Cached fils Don't Solution
If anybody has been having trouble with Boost successfully caching the files, but not serving them, I have detected one situation, Boost skips serving cached files when there is this cookie DRUPAL_UID, this is the case for logged users, if the pages "user", "user/password", "user/register", etc, get cached, somehow this keeps the DRUPAL_UID cookie existing for anonymous users, so.
Solution:
Now, everything should be working fine.
Boost
Thanks a lot your post help me lot and save me lots of time
:)
thanks great job
Front page not cached and not served... but all others pages yes
Hi,
We are trying to configure Boost in Drupal 7.24.
We've follow all Boost 7.x: installation instructions.
We are using apache 2.3 and our Drupal instance is in a folder named /var/www/html/portal/
We have this in our httpd.conf to put it as the server root: DocumentRoot "/var/www/html/portal"
Our url does not include a www prefix. (Ex: http//drupal7.portaltest.com/)
Here is our situation:
We've tried a lot's of tweaking, reading, testing and now we need your help...
P.S.
index
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# 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
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 %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=3]
# GZIP
RewriteCond %{HTTP:Accept-encoding} !gzip
RewriteRule .* - [S=1]
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html,E=no-gzip:1]
# NORMAL
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
### BOOST END ###
Thank's,
Simon Rousseau
CSSMI
Drupal 7 Boost is creating but not serving cached pages
I have a Drupal 7 site and I installed Boost which I have installed successfully on other sites. On this specific site, Boost is creating the cached pages but not serving them. I'm able to navigate to the cached pages using www.mysite.com/cache/normal/mysiteURL/cachedpage.html and the cached page displays correctly. I thought the problem might have been that the pages were being re-cached with every request but I checked and the cached pages appear to be remaining for the expiration period I've set so they are not being re-cached.
Can anyone suggest why Boost is able to create the cached pages but the system is not serving them?
thanks,
if the files created are not
if the files created are not being served try checking the rewrite rules.
You can enable rules logging in your httpd.conf file or vhosts file ...
I had the case on a WAMP local test instance that the Boost rewrite rules were not working because
ENV:boostpath was always empty - only found it by enabling the RewriteLog (after hours/days(!) of chasing other ideas)
Don't forget to turn the logging off again, once you're finished.
Try to change "Server's URL
Try to change "Server's URL or Name" settings from %{HTTP_HOST} to %{SERVER_NAME} and edit your .htaccess file.
@see http://stackoverflow.com/questions/2297403/http-host-vs-server-name
Raphael
Drupal Boost, Login admin/user not working htaccess
Hi,
I installed the Drupal Boost module on my website. Everything works fine, except that I can't login to the admin/user page after I paste the Boost-code in my .htaccess file.
When I fill in my credentials on /user page, nothing happens. If I delete the Boost-code from the .htaccess it works again.
Here is my .htaccess:
Thanks.
I have the same problem
Boost cant work properly. maybe its because i installed newer version of drupal 7.4.
For problem not be able to log in
Hi,
When you have the problem not being able to log in. See https://www.drupal.org/node/2354027#comment-9840245
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=2]
should be
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=1]
Greetings, Martijn
This does not work
Boost does not work with this
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=1]
the module does not work
Hello! we have installed Drupal 7.5 commerce and boost unit is not working. The module itself is installed correctly, all adjustments are made in .htaccess file. https://yadi.sk/i/MkCDj9QjuNF78 The main problem we have is not created in the folder cache /www/often/normal/site/. Rights record folders are created correctly. What can be, can something advise?
For some reason, html pages in the cache are not created?
No funciona la cache
Hola tengo boost en una version de drupal 7.60, el problema es que crea el fichero de cache pero no lo usa nunca siempre que recargo la web genera un fichero de cache nuevo. El tiempo de expiración de cache lo tengo en 4 semanas
Uso apache 2.4.29