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

malaysian.selangor’s picture

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

MrPeanut’s picture

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.

stephenglasgow’s picture

This module helped a lot - thank you!

vn_vasquez’s picture

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

bgm’s picture

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.

LBGreg’s picture

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.

bgm’s picture

Thanks for the feedback. I changed the formulation a bit to make it a bit clearer.

destinationsound’s picture

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!

darksnow’s picture

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.

sridharpandu’s picture

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,

sekhar33’s picture

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 !!!!

sridharpandu’s picture

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,

wanneng’s picture

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 ?

cristian100’s picture

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,

dagomar’s picture

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:

RewriteEngine on

  ### BOOST START ###
#Here the boost stuff.
  ### BOOST END ###

  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

  RewriteRule ^$ drupal/index.php [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^drupal/(.*)$ drupal/index.php?q=$1 [L,QSA]

  RewriteCond %{DOCUMENT_ROOT}/drupal/$1 -f
  RewriteRule ^(.*)$ drupal/$1 [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ drupal/index.php?q=$1 [L,QSA]

Hope this helps someone, this took me a couple of hours to debug.

Dagomar Paulides
B.A. Digital Media Design
Partner @ Online Agency

csscowboy’s picture

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

alifspb’s picture

Thanks a lot your post help me lot and save me lots of time
:)
thanks great job

borrico1965’s picture

This solution worked for me in speeding-up my site in a shared-hosting environment. Kudos!

cristian100’s picture

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:

  1. Add these exceptions to your boost caching pages at the admin settings page for Boost:

    user
    user/password
    user/register
    
  2. Log In, and Log out.
  3. Clean your cache and your COOKIES.

Now, everything should be working fine.

alifspb’s picture

Thanks a lot your post help me lot and save me lots of time
:)
thanks great job

Tocyd’s picture

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:

  • All site subpages are correctly cached and served
  • We are unable to make our front page cached and served (no _.html in /cache/normal/drupal7.portaltest.com/ and no redirection)
  • We've checked "Cache all pages but none of the listed above" in Boost module settings

We've tried a lot's of tweaking, reading, testing and now we need your help...

P.S.

  • We've checked the mod_rewrite.log and there is no redirection when we access http//drupal7.portaltest.com/
  • We've found this in the "/admin/config/search/redirect/404" config page:
    index
  • Here is our current boost .htaccess part

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

robinsf21’s picture

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,

jamescook’s picture

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

<VirtualHost *:80>
  ServerAdmin webmaster@.localhost
  DocumentRoot "C:\Users\xxxx\git\website-drupal"
  RewriteLog "C:\tmp\rewrite.log"
  RewriteLogLevel 9

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.

Raphael Apard’s picture

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

Developer007’s picture

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:

# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
# Options -Indexes

# Follow symbolic links in this directory.
# Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php index.html index.htm

# Override PHP settings that cannot be changed at runtime. See
# sites/default/default.settings.php and drupal_environment_initialize() in
# includes/bootstrap.inc for settings that can be changed at runtime.

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # https://www.drupal.org/https-information
  # Redirect all traffic from http://yourdomain.com and http://www.yourdomain.com to https://youdormain.com.
  RewriteCond %{HTTPS} off [OR]
  RewriteCond %{HTTP_HOST} ^www.yourdomain\.be*
  RewriteRule ^(.*)$ https://yourdomain.be/$1 [L,R=301]

  # Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

  # Make sure Authorization HTTP header is available to PHP
  # even when running as CGI or FastCGI.
  RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  # Block access to "hidden" directories whose names begin with a period. This
  # includes directories used by version control systems such as Subversion or
  # Git to store control files. Files whose names begin with a period, as well
  # as the control files used by CVS, are protected by the FilesMatch directive
  # above.
  #
  # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
  # not possible to block access to entire directories from .htaccess, because
  # <DirectoryMatch> is not allowed here.
  #
  # If you do not have mod_rewrite installed, you should remove these
  # directories from your webroot or otherwise protect them from being
  # downloaded.
  RewriteRule "(^|/)\." - [F]

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} .
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

 ### BOOST START ###

  # Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
  RewriteRule .* - [E=boostpath:normal]

#  # Apache 2.4 bug workaround
#  # Enables Search from home page https://drupal.org/node/2078595#comment-8724321
#  RewriteCond %{REQUEST_METHOD} ^(POST)$
#  RewriteCond %{REQUEST_URI} /
#  RewriteRule .* / [S=3]

  # 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=2]

#  # Apache 2.4 bug workaround
#  # Enables caching of index/ home page
#  RewriteCond %{REQUEST_URI} ^/index\.php$
#  RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html -s
#  RewriteRule .* cache/%{ENV:boostpath}/%{SERVER_NAME}/\_%{QUERY_STRING}\.html [L,T=text/html]

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

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

  # Rules to correctly serve gzip compressed CSS and JS files.
  # Requires both mod_rewrite and mod_headers to be enabled.
  <IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

# Add headers to all responses.
<IfModule mod_headers.c>
  # Disable content sniffing, since it's an attack vector.
  Header always set X-Content-Type-Options nosniff
</IfModule>

Thanks.

fikifir’s picture

Boost cant work properly. maybe its because i installed newer version of drupal 7.4.

Summit’s picture

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

donovanrod’s picture

Boost does not work with this

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=1]

matvejchev’s picture

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?

Juan Lu’s picture

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