Installation & Settings 6.x-1.03
This page is a walk-through of the steps and the 6.x-1.03 UI pages, so everything will look familiar.
This might look a little overwhelming, but It's easy. With a few selections during setup along with the default settings, it will work fine in most cases.
- Installation
- Performance /Boost Settings
- Boost file or static page cache
- Boost cacheability settings
- Directories and file extensions
- Boost advanced settings
- Boost crawler settings
- Apache htaccess Rules Generator
- Prepare htaccess for Boost
- Prepare settings.php for cron
- Drupal /Performance Settings
- System check, verify functions
- Administrative blocks
Steps to install
- Download Boost, Transliteration, Globalredirect and unzip the modules on your computer.
- Note: Globalredirect and Transliteration are not required, but are suggested or recommended.
- FTP or upload the module folders with all their contents(as is) to sites/all/modules
- Goto: Administer > Site configuration > Clean URLs
system pathadmin/settings/clean-urls
Ensure that Drupal's clean URLs are enabled and working correctly. - Goto: Administer > Site building > Modules
system pathadmin/build/modules/list
Enable the Boost module in the Caching section, Transliteration, Globalredirect and Poormanscron if used. - Save the settings to install (updates the database)
After saving the settings, there will be a link at the top of the module page directing you to the (Performance/Boost settings) UI page. - After the module has been enabled, a notice will display
(Drupal's standard page caching disabled by Boost.),
we will turn this back on after setting up the module. - Configure the settings on the (Performance/Boost settings) page.
Goto: Administer > Site configuration > Performance > Boost settings
system pathadmin/settings/performance/boost - Configure the settings on the (Performance) page.
Goto: Administer > Site configuration > Performance
system pathadmin/settings/performance - Copy rules from Boost htaccess rules generation to the Drupal htaccess file.
Goto: Administer > Site configuration > Performance > Boost htaccess rules generation
system pathadmin/settings/performance/boost-rules
Performance /Boost Settings [tab]
- Goto: Administer > Site configuration > Performance > Boost
system pathadmin/settings/performance/boost
Boost File cache
Static page caching is a mechanism that stores dynamically generated web pages as HTML files in a special cache directory located under the Drupal installation directory. By caching a web page in this manner, the web server can serve it out in the fastest possible manner, without invoking PHP or Drupal at all. While this does provide a significant performance and scalability boost, you should note that it could have negative usability side-effects unless your site is targeted at an audience consisting mostly of "anonymous" visitors.
- Boost - Static page cache: Choose Enabled for Boost to work.
( ) Disabled
(x) Enabled
( ) (Not Recommended) Set Boost & Core (if enabled) cache for each page - Gzip page compression (Boost & Core): Radio buttons
( ) Disabled
(x) Enabled (Default) - By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a web server that performs compression.
- Boost - HTML - Default minimum cache lifetime:
[1 Hour] (select) - Default is 1 hour and can be increased for sites that do not change very much. The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied. Cache lifetime gets checked on cron runs.
- Boost - XML - Default minimum cache lifetime:
[1 hour] (select) - The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied. Cache lifetime gets checked on cron runs.
- Boost - JSON - Default minimum cache lifetime:
[1 hour] (select) - The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied. Cache lifetime gets checked on cron runs.
- Clears the cache of all pages currently in the cache files. Great for seeing current changes when working on the site or after adding content. Visitors will see changes immediately without waiting on a cron run to clean the cache and regenerate the pages.
- Clears all pages that are past the cache lifetime. You may have been logged in during the cron run and nothing was cleared due to being logged in. It's like a manual cron run.
[Clear ALL Boost cached data: (20) pages] (button)
[Clear Boost expired data: (15) pages] (button)
Boost cacheability settings
- [x] Cache pages that contain URL Variables
- Boost will cache pages that end with ?page=1 among others. (anything with a "?" in the url)
- [x] Cache html documents/pages
- Boost will cache most Drupal pages.
- [ ] Cache .xml & /feed
- Boost will cache .xml and /feed urls as xml data.
- [ ] Cache ajax/json
- Boost will cache ajax/json responses.
- [x] Cache .css
- Boost will cache CSS files.
- [x] Cache .js
- Boost will cache javascript files.
- Statically cache specific pages: (radio buttons).
(x) Cache every page except the listed pages
( ) Cache only the listed pages
( ) Cache pages for which the following PHP code returns TRUE (PHP-mode, experts only).
Pages:
[ text box ] This is a standard Drupal type of setting. - Enter one page per line as Drupal paths. The '*' character is a wild-card. Example paths are 'blog' for the blog page and blog/* for every personal blog. is the front page.If the PHP-mode is chosen, enter PHP code between
<?php and ?>. Note that executing incorrect PHP-code can severely break your Drupal site.
Boost directories and file extensions
- Cache Dir: *
[ cache ] - This is the default directory that will hold the cached files or pages.
- [ ] Do not store the cache file path in the database
- Enabling will allow for correct multi-site caching, in cases where different content is served from the same Drupal installation, based on domain.
Examples: Multi-site with a single/shared database, site translation detection based on domain, and the contributed "Domain Access" module. - Cache file path: *
[ cache/www. example.com ] - A file system path where the static cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named cache/ under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.
Generated output storage (HTML, XML, AJAX) -expandable section-
- Dir for non compressed files:
[ _______ ] - Leave blank to not use a subdir
- Dir for compressed files:
[ gz _____ ] - Leave blank to not use a subdir
- Character used to replace "?": *
[ _ ____ ] - Best to leave at _
- Cache html file extension: *
[ .html _ ] - The file extension to append to the file name of the generated cache files.
Note: This setting is of no relevance to any public URLs, and it is strongly recommended to leave this as the default '.html' unless you know what you are doing. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.
Static storage (CSS, JS) -expandable section-
- Dir for more permanent files (css/js):
[ _______ ] - Leave blank to not use a subdir
- Dir for compressed more permanent files (css/js):
[ gz _____ ] - Leave blank to not use a subdir
- Character used to replace "?" in the permanent dir: *
[ _ _____ ] - Best to leave at _
- Cache css file extension: *
[ .css ___ ] - The file extension to append to the file name of the generated cache files.
Note: This setting is of no relevance to any public URLs, and it is strongly recommended to leave this as the default '.css' unless you know what you are doing. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work. - Cache javascript file extension: *
[ .js ___ ] - The file extension to append to the file name of the generated cache files.
Note: This setting is of no relevance to any public URLs, and it is strongly recommended to leave this as the default '.js' unless you know what you are doing. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work.
Boost advanced settings
- Clear expired pages on cron runs: (radio buttons).
( ) Disabled
(x) Enabled - Caution - If disabled you will need some other method of clearing cached pages. If disabled, files have to be manually deleted from server or cleared using the administrative interface (Enable the Boost: Pages cache status block).
- [ ] Check database timestamps for any site changes. Only if there's been a change will boost flush the expired content on cron. (this helps to reduce server load by keeping cached pages that have not changed)
- Pre-process function:
[ < c o d e > ] - The name of a PHP function used to pre-process the contents of each page before writing them out to static files. The function is called with the contents of the page passed as a string argument, and its return value is used as the data written out to the disk. (It is rare that anyone will need this)
- [x] Only allow ASCII characters in path.
- Only allowing ACSII characters is a safe way to cache pages. It severely limits i18n support so this can be turned off. Fair warning, disabling this may cause "page not found" errors depending on your url structure (spaces are bad, ect...). If you follow RFC 3986 you should be ok.
- [x] Asynchronous Operation: output HTML, close connection, then store static file.
- Run php in the background. When a cached page is generated, this will allow for faster page generation; downside is the headers are not the standard ones outputted by drupal; sends "Connection: close" instead of "Connection: Keep-Alive".
- [x] Clear all empty folders from cache.
- Disable this if you have to set settings for each dir/subdir, due to the way your server operates (permissions, etc...).
- [x] Clear all cached terms pages associated with a node on insert/update/delete
- Works with view's taxonomy/term/% path as well as core.
Note: When a node belongs to term/1 and it gets created/updated/deleted, the cached page(s) for term/1 will be cleared. - [x] Clear Boosts cache when site goes offline.
- Under site maintenance when the status is set to offline, boost clears it's cache. If you do not want this to happen, clear this checkbox. Pages that are not cached will still send out a Site off-line message, so be smart if turning this off.
- [ ] Overwrite the cached file if it already exists.
- This is useful if crawling a site before it goes live.
Note: Required if using the "Do not flush expired content on cron run, instead re-crawl and overwrite it" functionality. - [ ] Do not cache if PHP error on page.
- Selected - Do not cache the page if there are PHP errors.
Not Selected - Cache pages even if it might contain errors.
Note: Enabling this can get quite annoying because there's a lot of code out there that may throws errors. - [x] Do not cache if a message is on the page
- Selected - Do not cache the page if there are drupal messages.
Not Selected - Cache pages even if it might contain a drupal message. - [ ] Turn off clean URLs for logged in users.
- Drupal will output non clean URLs for non anonymous users. This allows for the browser to cache the page and still have logging in work. This is more on the extreme side of tweaks.
Note: Recommended for sites that don't change much and have only administrator logins. Enabling requires you to update your htaccess file with new rules. Allows for users that hit the same page to not hit your server. Also allows for reverse proxies to cache the page. - [ ] Aggressive Gzip: Deliver gzipped content independent of the request header.
- In order to deliver gzipped content independent of the header, this will test for gzip compression in a small iframe by sending it compressed content. This compressed content is javascript which creates a cookie with a note of gzip support. On the server side it checks for the cookie and then sends out gzipped content accordingly. See Website Performance - Activate Gzip. In short some firewalls/proxies mangle the gzip header; this gets around that. iframe is on non compressed version of the frontpage only.
- Files: Enter in a 4 digit number (octal) that will be used by chmod(). Example 0664:
[ _______ ] (text box) - Sometimes because of funky servers you need it use a different file mode then the default.
- Directories: Enter in a 4 digit number (octal) that will be used by chmod(). Example 0775:
[ _______ ] (text box) - Sometimes because of funky servers you need it use a different file mode then the default.
- Ignore cache flushing:
[x] Disabled
[ ] Only Ignore Clear Entire Cache Commands (Recommended if caching css/js files)
[ ] Ignore Clear Entire Cache Commands & Cron Expiration
[ ] Ignore All Delete Commands (Not Recommended) - Ignore flushing notes: Make a selection to put your site into a static cached state. It is Recommended to turn on CSS & JS caching if one of these are selected. If you do NOT want the cache cleared completely choose the first selection.
- Watchdog Verbose Setting:
[5 Record all errors to the db log] (select box) - This sets the amount of errors recorded to watchdog(DbLog) when a static state is selected.
Boost crawler
- [ ] Enable the cron crawler
- Pre-cache boosted URL's so they get cached before anyone accesses them. Enable the crawler first and save settings to use Preemptive Cache settings.
- [ ] Do not flush expired content on cron run, instead re-crawl and overwrite it.
- The "Overwrite the cached file if it already exists" must be turned on in order to enable this.
Notes:
Enable for fast but potentially stale pages.
Disable for slow but always fresh pages.
Very useful for shared hosting if used in conjunction with the "Check database timestamps for any site changes" setting. If your site takes a long time to generate a page (more then 3 seconds) then this is highly recommended. Updating your htaccess rules is required if turning this on. - [ ] Preemptive Cache HTML
- Enable caching of this content type with this checkbox.
- [ ] Preemptive Cache XML
- Enable caching of this content type with this checkbox.
- [ ] Preemptive Cache AJAX/JSON
- Enable caching of this content type with this checkbox.
- [ ] Crawl All URL's in the url_alias table.
- Enable the crawler first to enable this checkbox.
Note: Recommended that you do not leave this turned on. Use it to kick start the boost cache on a new install. - Crawler Throttle:
[ 0 ] (enter a number in micro seconds) - Wait X micro seconds in between hitting each url. 1000000 is 1 second.
- Crawler Batch Size:
[ 12 ] (enter number of URLs) - Number of URL's each thread grabs per database operation.
- Number Of Threads:
[ 2 ] (select box) - Be careful when choosing more then 2 threads.
- Resets the crawler and clears the cron semaphore entry from the database (a clean slate).
[Reset Crawler & Cron Semaphore] (button)
Boost Apache .htaccess Rules Generator
After settings on the entire page
have been saved. Goto: Boost htaccess rules generation page, copy the rules and paste them into the Drupal htaccess file.
(see next section below: Prepare htaccess for Boost)
The default selections in this section should work for most sites.
- Servers URL or Name:
[x] %{SERVER_NAME}
[ ] %{HTTP_HOST}
[ ] localhost - Best to leave these as %{}, only try the last option(s) if boost is still not working.
- Document Root:
[x] %{DOCUMENT_ROOT}
[ ] C:/wamp/www - Value of is recommended for this server. Please open an boost issue on drupal.org, since apache and php are not configured correctly.
Important htaccess Notes: The htaccess rules will be automatically generated for the selections that are made on the entire Boost settings page. This is done to make Boost as fast as possible.
The boost/htaccess folder contains sample rules that can be used, however, the generated rules will make Boost faster!
(see next section below: Prepare htaccess for Boost)
Clear Boost's Database
- [Reset boost database:(0) records] (button).
- Warning: This gives you a clean slate for the boost database, use with caution.
[Save Configurations] (button) [Reset to Default] (button)
Prepare .htaccess File for Boost
Required for cached pages to be served.
- This is easy and anyone can do it without any trouble, follow along.
Save a copy of the .htaccess file from your Drupal folder for safe keeping.
It's easy to get a new one anytime if you need it, Drupal is always open.
Goto: Administer > Site configuration > Performance > Boost htaccess rules generation
system path admin/settings/performance/boost-rules
Right click anywhere in the iframe that displays the rules, Left click on Select All
(highlights the text), Right click again, Left click on Copy
(that puts the file on your clipboard).
Double click on the Drupal .htaccess file to open it. Look down through the file to see the part(shown below) It's 8 lines from the bottom.
# RewriteBase /
(Left click once between these 2 lines, Right click and choose Paste
)
# Rewrite URLs of the form 'x' to the form 'index.php?q=x' .
Save the file. Put it back in with the rest of the Drupal files where it was.
All done, the pages should now be served by Boost after all the settings are completed.
Check the pages using the instructions in the (system check) section on this page. If they are not showing the html comment, try different selections in the htaccess generator on the performance/boost settings page.
Additional notes for htaccess:
The module package has 3 htaccess templates included in the Boost/htaccess folder (boosted1.txt, boosted2.txt and default.txt). These templates may be helpful in some cases and are good for reference. The default.txt shows the exact placement of the rules. The boosted1.txt relying on SERVER_NAME and boosted2.txt relying on HTTP_HOST. These templates are there if you should need them. It is always best to use the htaccess generated rules from the UI, as they will allow boost perform better and faster by providing custom htaccess rules tailored to your settings.
Prepare settings.php File for Cron
-------------------
This is a cut away of the settings.php file(about half way down)
-------------------
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!-------------------
Add the
website URL between the ( ' ' ) as in the example above.Remove or delete the
# so it will work.-------------------
Drupal Performance [tab]
- Goto: Administer > Site configuration > Performance
system pathadmin/settings/performance
Anonymous page caching
Enabling the page cache will offer a significant performance boost. Drupal can store and send compressed cached pages requested by anonymous users. By caching the first request to the page, Drupal does not have to construct the page each time it is viewed. The page must first be visited by an anonymous user in order for the cache to work on subsequent requests for that page. Boost & Core caching do not work for logged in users
- Caching mode:
( ) Disabled
(x) Normal (recommended for production sites, no side effects)
( ) Aggressive (experts only, possible side effects) - Minimum cache lifetime:
[< none>] (select box) none is fine for small sites. - On high-traffic sites, it may be necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied and recreated, and is applied to both page and block caches. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.
- Gzip page compression (Boost & Core):
( ) Disabled
(x) Enabled - By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression.
[Clear core page cached data: (0) pages] (Button)
Block cache
Enabling the block cache can offer a performance increase for all users by preventing blocks from being reconstructed on each page load. If the page cache is also enabled, performance increases from enabling the block cache will mainly benefit authenticated users.
- Block cache:
( ) Disabled
(x) Enabled (Recommended) - Note that block caching is inactive when modules defining content access restrictions are enabled.
Bandwidth optimizations
Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.
These options are disabled if you have not set up your files directory, or if your download method is set to private.
- Optimize CSS files:
( ) Disabled
(x) Enabled (Recommended) - This option can interfere with theme development and should only be enabled in a production environment.
- Optimize JavaScript files:
( ) Disabled
(x) Enabled (Recommended) - This option can interfere with module development and should only be enabled in a production environment.
Clear cached data
Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. To refresh all cached data on your site, click the button below. Warning: high-traffic sites will experience performance slowdowns while cached data is rebuilt.
- [Clear cached data] (button)
- Clears the database and the Boost cache.
[Save configuration] (button) [Reset to Defaults] (button)
System Check and Verify Boost Functions
- Check the status page
Goto: Administer > Reports > Status report
system pathadmin/reports/status
Check for any errors or notices. - Log out from Drupal (or use another browser) to browse around your site as an anonymous user. Ensure that static files are indeed being generated into the Boost cache directory specified. If you opted to use gzip, check that gzipped files are being generated in the directory you specified for gzip. The performance settings page shows how many pages are being cached by Boost, and (for pages Boost cannot cache) by Drupal core.
Check Pages to Insure Boost is Performing
To check whether you have a static or dynamic version of a page. Visit the page as an anonymous user, visit a second page, then back to the original page. Click view source in your browser and look at the very end of the HTML source code. You have the cached or static version produced by Boost if the last line looks like this:
<!-- Page cached by Boost @ 2009-08-11 06:19:58, expires @ 2009-08-11 09:19:58 -->
Need help? Use the Drupal "Post Installation" (Forum).
Use a descriptive title for the post to get better help and get it faster.
(or) Request support in the Boost (issue que).
Boost Administrative and Stats Blocks
There are 2 blocks that you can add to help with the administrative side (status, page configuration), and 1 block to support core stats.
Goto: (administer > Site building > Blocks > List) to place them.
Status Block
This block shows the current status of the page as far as Boost is concerned. It will state if the page is served 'live' or by 'Boost', the expiration of the page and has a Flush Page button to clear the page from the cache manually. The block only appears if your not user 0 and provides useful information about PHP errors on the page.
Page configuration Block
This block allows the administrator to set pages individually. Including setting for minimum cache lifetime(select box), preemptive cache(on or off), scope(page ID, content type or content container).
Stats Block
Drupal's core stats is supported. Configure the "Popular content" block, but then disable it. Place the "Boost: AJAX core statistics" in its place. If ajax stats are loading too slowly, copy stats/boost_stats.php to your webroot and enable "Cache Statistics Block". The cache gets updated on cron runs. This only shows up on pages that get cached and can be used to collect data and not display it.


