📜 ⬆️ ⬇️

Solve problems with installing Web Optimizer

After numerous installations of the application for automatic acceleration of sites - Web Optimizer on Joomla! (both versions 1.0 and 1.5) it was decided to put together useful knowledge about emerging issues (associated mainly with the current incorrect server environment) in order to allow them to independently solve a large number of users.

So, let's understand in order what we do in the following cases.

Download Web Optimizer: code.google.com/p/web-optimizator/downloads/list
')

Web Optimizer Operation


Quite often, you have to figure out whether Web Optimizer is working on the site, or its installation has somehow not connected to the processing of an HTML document. Starting with version 0.5.2, this can be set by finding the <title lang="wo"> in the page code (if the label is absent there, it means Web Optimizer does not work).

For earlier versions, this decision can be made based on the absence in the HTML document code of indentation at the beginning of a line, double line feeds or the presence of characteristic cached file names in the head section ( cache/1234a6789b.css or cache/1234c6789d.js , here 1234c6789d - random string in hexadecimal notation).

If it was not possible to detect traces of Web Optimizer, then it is necessary to double-check the correctness of Web Optimizer calls in the content management system files and, possibly, install the application again - this way Web Optimizer will be able to independently make all necessary changes.

If you need to obtain information about the necessary changes to the CMS source files, you should disable the automatic change of /index.php during the installation:
  Change /index.php -> Enable Auto-Record -> No 

and at the last step go to the tab “Necessary changes”.

"Croozy" instead of the site


This is usually due to double compression of the HTML document. One of the compression can be imposed by the Web Optimizer itself, and the second - as used by the site management system, and the server.

To remove one of the superimposed compression, you can disable it either in the CMS, or in the server configuration, or in the Web Optimizer itself:
  Archiving settings -> Apply gzip to HTML -> No 


White screen instead of the site


The main problem with the appearance of a white screen (exceeding the memory limit when creating CSS Sprites) has already been fixed in version 0.5+, so if you have an older version, then you just need to update it.

It is also worth looking into the error logs of your server to find out what caused this condition. This usually helps to solve the problem.

In some cases, a white screen occurs due to incorrect installation of the application or double compression. How to solve these problems is described just above.

If all the above steps have not brought results, then you can try to disable some of the Web Optimizer settings in order to understand what things your server can do on its own. You should start with the root set (“Compression Settings” and “Archiving Settings”) for all three groups (CSS, JavaScript, HTML) of optimization actions and move towards connecting more detailed parameters (for example, “Include external files”, “Eternal”) caching "or" CSS Sprites ").

Inappropriate appearance


This may cause various problems, but first you can try disabling CSS Sprites:
  CSS Sprites -> Apply CSS Sprites -> No 

then, if this does not help the situation, you can disable the data:URI :
  Data: URI -> Apply data: URI -> No 

After these steps, all the included CSS files will not be processed through CSS Tidy, but will only be merged (and initial minimization will be performed).
If after this the appearance of the site is “parted”, then it is necessary to disable the merging of styles inside the head
  Include external files -> Enable merge external CSS files -> No 

mlm general minimization for CSS files
  Compression settings -> Minimize and merge CSS files -> No 

If there is a desire to understand the problem that has arisen in more detail, then you can, with the combining of styles inside the head disabled, try to exclude one by one using the following setting:
  Include external files -> Exclude files from the union -> Space list of files 

Find the files (or those files) that are processed incorrectly, bring them to the standard state using the validator jigsaw.w3.org/css-validator/ and try to merge again.

Missing or Incorrect Background Images


In some cases, problems after installing Web Optimizer boil down to the fact that some background images disappear or "spoil". To solve this set of problems, it is necessary to establish with what initial background images difficulties arise (using any means for debugging the layout) and exclude these images from the process of creating CSS Sprites:
  CSS Sprites -> Exclude files from CSS Sprites -> Space list of files 

If this measure fails, then CSS Sprites can be turned off altogether:
  CSS Sprites -> Apply CSS Sprites -> No 


Incorrect site behavior


Usually it comes down to the fact that part of the client logic stops working. It should be well understood that if, for example, a form for entering comments on your site is displayed using JavaScript, and after Web Optimizer it has stopped outputting, then these are problems not of appearance, but of client logic.
To isolate problems with client logic, it is recommended to try to disable the minimization of JavaScript files:
  Compression Settings -> Minimize and Merge JavaScript Files -> No 

and then (when saving the problem) try to exclude separate files one by one:
  Include external files -> Exclude files from the union -> Space list of files 

When establishing the name of the file on which the merge fails, you can simply exclude it from the general package or try to configure its correct inclusion in the original logic (usually errors occur due to incorrect syntax of source files that do not conflict within the same file environment but start to conflict when combining these environments).

Unavailability of files for users


Sometimes there are problems with the display and operation of the site for all users, although the owner of the site (in his browser) is doing well. If the diagnosis of the problem sounds like this, then you need to check at what address the caching directories are located, the Web Optimizer itself and whether Web Optimizer protection is enabled from external access:
  Using .htaccess -> Protect a Web Optimizer installation with 
 htpasswd -> Yes 

In this case, the caching directories should be removed from the folder of the Web Optimizer itself (for example, to the cache root directory, which is writeable for the web server) or the application protection should be disabled:
  Using .htaccess -> Protect a Web Optimizer installation with 
 htpasswd -> No 


Lack of support for multiple hosts


If you want to enable multiple parallel hosts to speed up the loading of static resources, then you should check the following points:
  1. Availability of support for these hosts in DNS. To do this, you need to make records corresponding to these hosts in your DNS zone, indicating the required IP address (usually the same as the current site).
  2. Enable support for these hosts at the server level. For Apache, this is done by the ServerAlias directive, for example:
      ServerAlias ​​i1.site.ru
     ServerAlias ​​i2.site.ru 
  3. Check that these hosts mirror the main site. To do this, take the address of any static object on the site (for example, site.ru/images/my.png ) and try to open it through all additional hosts ( i1.site.ru/images/my.png ). If there are any problems, you must repeat the previous steps.
  4. Add the specified hosts to the Web Optimizer configuration
      Multiple hosts -> Available hosts -> Host name separated by spaces 

    and enable support for multiple hosts
      Multiple hosts -> Enable parallel hosts, for example, i1 i2 -> Yes 

    Web Optimizer automatically checks several of the most common hosts, and the latter configuration may not be required.

After the described actions, all images on the site will be given through several hosts, which will significantly speed up the loading of each page.

Errors and documentation noted


Documentation and description of the application will grow and grow. at the moment an article has already been published with a description of the settings and an article with a step-by-step installation guide .

Part of the documentation (mainly on the principles of work) is available in English here: code.google.com/p/web-optimizator/w/list

Some known problems and methods for solving them have already been described in a previous article . If you have detected incorrect Web Optimizer behavior for your site, you can post a description of the error (Google account is required) or view all known (or resolved) issues . At the moment, the average time to solve a problem is about a day (usually several hours).

You can also try to solve the problem online, using the specified contacts .

Efficiency


Several results of using Web Optimizer (for a “clean” installation of the system, without any preliminary optimizations) are given here . The YSlow score rises to 89-97, the client download speed is 2-3 (less often 3-5) times. Web Optimizer itself after creating cached files spends only 3-10ms to check and update the output HTML document (with default settings, correct HTML compression into one line is quite a resource-intensive operation and can take another 50-100ms).

Download Web Optimizer: code.google.com/p/web-optimizator/downloads/list
Support the project financially: sprites.in/donate

Source: https://habr.com/ru/post/63753/


All Articles