Expires is responsible for how long the cache is up to date, and the browser can use cached resources without asking the server for a new version of them.

Go to Server → nginx → configure



After making changes to the configuration file, you need to check the Restart box and click Save

You may also log in via SSH to the server and edit nginx.conf configuration file which is located in /etc/nginx/, find configuration block server {}. This configuration block has a location section for handling static documents.

Example Nginx configuration for Expires control

server {  
    location ~* \.(gif|ico|jpe?g|png)(\?[0-9]+)?
        expires 1w;

    location ~* \.(css|js)$
        expires 1d;

where expires is the number of days how long the cache of static files will be kept.

*Page compression in the Nginx+Apache bundle

To enable compression in browsers supporting this technology, simply create an empty file .htdeflate in the root directory of the website.

To maintain this method you will need to add the following lines to the virtual host file

set $root /home/USERNAME/www;  
set $deflate "${root}/.htdeflate";  

location ~* ^.+\.(css|js)$ {  
    root $root;
    if ( -f $deflate ) {
        gzip on;
    gzip_disable msie6;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 9;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;

If you have any configuration difficulties or have additional questions, you can always contact our support team via ticket system

Updated Sept. 18, 2018