about uscontact

Increase wordpress performance

Author: zemna
Date: April 17, 2021
Share this:

configure gzip compression with NGINX

Open up the file /etc/nginx/nginx.conf

sudo vi /etc/nginx/nginx.conf

Comment that out gzip options

gzip on;
gzip_vary on;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;

Restart NGINX server

sudo service nginx restart

Configure browser cache

Open up the site configuration file

sudo vi /etc/nginx/sites-enabled/your_website.conf

Set cache expiration to max

location ~* .(png|jpg|jpeg|gif|svg|webp)$ {
expires max;
add_header Cache-Control "public, no-transform";
log_not_found off;
access_log off;
}

location ~* .(js|css|pdf|html|swf|woff|woff2)$ {
expires max;
add_header Cache-Control "public, no-transform";
log_not_found off;
access_log off;
}
Share this:

Leave a Reply

Your email address will not be published.

ZEMNA.NET

Professional software development agency estalished in Indonesia. We offers website setup, web application development, fulfillment service, and etc.
Follow us
Follow us to get latest news and tutorials.
2022 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️
magnifiercrossmenu