Report this

What is the reason for this report?

Leverage browser caching for Nginx

Posted on July 28, 2014

I am trying to speed up my Wordpress site. On GTmetrix I am receiving a E(50) for Leverage browser caching.

I am trying to add the code below to my /etc/nginx/nginx.conf file

location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
        expires 365d;
    }location ~*  \.(pdf)$ {
        expires 30d;
}

Unfortunately any attempt at restarting nginx ends in a [fail]

Please help!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.