We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.3.1.5. Browser static caching

Using browser caching can speed up the loading of the site on repeat visits and reduce the number of requests to the server. The bottom line is that when you first visit the site, the server tells the browser how long it needs to store copies of the downloaded static files... When re-accessing the site, the browser already uses the local copies of the files saved in the cache and does not contact the server to get them.

To configure browser caching of static files, do the following:

  1. Openup site settings.
  2. Opposite "Caching»Select the period during which static resources will be stored in the client's browser (1, 3, 8 or 12 hours, 1 day, 1 week or 1 month):If the standard periods are not suitable, select "Your option»And indicate the required period in hours:
  3. Save your changes.
  4. Wait approximately 15-30 minutes for the changes to take effect.

Setting up caching through the control panel sets a single period for all types of static files. If you need to set individual caching periods for certain file types, do the following:

  1. Take away from list of static files file extensions for which you want to set an individual cache period.
  2. Write the caching directives in the file .htaccess.

Examples of caching directives:

# cache html and htm files for a day
<FilesMatch "\.(html|htm)$">
  Header set Cache-Control "max-age=43200"
</FilesMatch>
# cache css and js files for a week
<FilesMatch "\.(css|js)$">
  Header set Cache-Control "max-age=604800"
</FilesMatch>
# disable caching of txt and zip files
<FilesMatch "\.(txt|zip)$">
  Header unset Cache-Control
</FilesMatch>
 
ExpiresActive On
# default cache 30 seconds
ExpiresDefault "access plus 30 seconds"
# cache html and htm files for a day
ExpiresByType text/html "access plus 43200 seconds"
# cache css and js files for a week
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"