My favorites | Sign in
Logo
             
Search
for
Updated Nov 10, 2009 by sunny.dreamwind
Labels: Id-3., Featured
Locales: en, ru
Configuring  
Configuring

Configuring

Below are listed several groups of options to configure in latest version of Web Optimizer.

Options groups

  • Multiple hosts. This option allows you to enable images' distribution through multiple static hosts. Every image will be associated with the only host (to avoid caching one image from all available hosts). To use this acceleration technique you need to add to DNS all alternative hosts for the IP address which will serve them (usually it's the same as for the main website) and add to server configuration some aliases fir the main website. For example:
  • ServerAlias i1.site.com
    ServerAlias i2.site.com
After this you need to add i1 i2 to Web Optimizer hosts' list and make sure that images are distributed through these hosts. During installation Web Optimizer automatically checks a number of default hosts to use them as alterative (with the same website root), also all set hosts are checked for availability (test images are loaded from them). Please keep in mind that enabling "protection" for Web Optimizer installation (there are some words about this option below) automatic hosts' check can be performed properly and you need to set list of hosts by hand, without Web Optimizer installation restart. Automatic check can be disabled if it's required.
  • .htaccess. Most of gzip and cache settings can be written via web server configuration file to avoid overhead of server scripts. This can be performed with .htaccess file (if you want you can transfer all settings to httpd.conf file manually after installation). Web Optimizer automatically checks for available Apache modules and configures . htaccess records accordingly (of course this file must be writeable). mod_gzip, mod_deflate, and mod_filter handle for gzip "on fly", mod_rewrite and mod_mime — for static archives. mod_headers and mod_setenvif — for correct rules for gzip in old browsers and proxy servers. mod_expires — for correct cache expires headers. Also you can place .htaccess either in the website directory (it can be useful if you have a lot of sites inside different folders), or right in the website root. Be default both locations are equal. Also you can protect Web Optimizer installation with .htpasswd. In this case to perform all setup and configuration you need to provide login and password through HTTP Basic Authorization in your browsers (this allows you to move Web Optimizer to any folder of your website, but don't forget to move cache directories outside protected Web Optimizer installation).
  • Footer text. There is small stamp in the right bottom corner of the optimized website "Accelerated with Web Optimizer" with the link (with rel="nofollow" attribute) to the project website. There are 3 different stamps available.
  • Changing /index.php. Web Optimizer supports automatic change required CMS's files for several dozens of systems (in case of unknown system it is displayed as CMS 42, and only root index.php is changed in a standard way). Before automatic change Web Optimizer performs chained optimization of the home page (to create all cached files and avoid long delay on the first load of optimized website).

Manual configuration recommendations

Here is the list of recommended changes in Web Optimizer configuration.

Please notice that these settings make additional load to the server (correct regular expression is very expensive) and can lead to exclusion of some JavaScript code (that is included via comments). Also all code inside script, textarea, pre won't be changed (due to HTML specification). So please use these settings very carefully.
  • Images optimization via smush.it. Smush.it service has been developed by Yahoo! and Google engineers and allows you to optimize file size of any images automatically. You can enable images' optimization via CSS Sprites library:
  • <?php
    require('/full/path/to/css.sprites.php');
    $smushit = new css_sprites();
    $smushit->smushit('/full/path/to/image');
    ?>
After this instead of initial image (if there are sufficient rights to replace it) we will have its optimized copy. It's better to perform this operation not on live images but on their copies - to have opportunity to roll back all changes.
  • Protected installation. Web Optimizer can be installed into any folder (inside you website) and protected with htpasswd. To do this you need to enable:
  • Use .htaccess -> Protect Web Optimizer installation via htpasswd -> Yes
With this option you must be sure that Cache Directories are located outside the Web Optimizer folder (otherwise the whole website will be broken for all visitors except you). With HTTP Basic Authorization Web Optimizer will use the same username/password you entered on installation (or on settings configuration).

Sign in to add a comment
Hosted by Google Code