Increase wordpress performance

January 17, 2021
zemna@zemna.net

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;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram