Dynamic and static content compression

The main difference between dynamic and static pages is that static pages will remain unchanged for all the time until the file representing this page will not change on the server. Dynamic pages, on the contrary, may change their content based on a variety of factors like database values, different parameters and header values, etc. Helicon Jet cannot analyze all these factors to decide if the page was changed or not. What does this mean to HTTP compression? Only that by default dynamic pages should not be cached.

Helicon Jet can recognize the difference between dynamic and static types of pages and allows you to specify different compression settings for static and dynamic content.

With a static content Helicon Jet can check last file modification date and update cached data immediately after the modification to the master file is made. This means that you don’t need to specify cache expiration period for static pages and cache can be safely turned on.

But with dynamic pages you usually disable server-side cache, and compression is done every time the page is requested, thus causing more processor consumption. This is why default compression level for dynamic pages is set lower than for static ones – to save processor time.

But for some conditions enabling caching for dynamic contentit can be a life-saving opportunity. Dynamic pages usually run much slower than static ones, especially if you need to query some databases to generate page content. You can save up to 90% of processor time just by enabling cache for a specific page. When the page is retrieved from cache no database requests are made, no calculation is required - this may save really a lot of time. If you have some highly loaded dynamic page (like a homepage of the site) or site area, you may enable caching if the following conditions are met:

  • Page does not require a user login
  • Page does not contain any user-specific information
  • Content of the page does not have to be always up-to-date at every moment - there could be some delay before the information will be updated.

If your dynamic content does not meet these requirements, server-side caching should not be used for it.

To enable dynamic content cache you may need to turn on “Append query string to cache files” parameter in the Common settings. This will append query string values to the file names in the cache causing Helicon Jet to create different cache entry for every query string parameter and value set. Then add an entry in the Directory (URL) patterns list pointing to this page or web site area. This entry should be at the beginning of the list to override “/” entry settings. Modify dynamic compression settings for this entry as follows:

  • Increase compression ratio. Since caching will be used, processor load will not be a case and smaller files will cause into fewer loads to the server.
  • Enable caching for dynamic content.
  • Set the Cache expiration timeout to some reasonable value. The dynamic page will always contain data not older than this timeout. For example if page is requested 10 times per second, even setting timeout to two seconds will save approximately 65% of processor time. But we suggest you to use more reasonable values from 60 to 600 seconds.