Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

1

Leverage browser caching for Nginx

By
Mark
on 11/16/16, 10:55 PM 3,817 views

How to speed my Wordpress Leverage browser caching for nginx?

I did add code the code below on my /etc/nginx/nginx.conf

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

    }location ~* \.(pdf)$ { expires 30d;

}


but it not working


0
mahbub
On 11/16/16, 11:09 PM

you need to add that inside your nginx vhost in:

/etc/nginx/sites-enabled/default


server { listen 80;

    server_name localhost;

    location / { root /usr/share/nginx/html;

        index index.html index.htm;

    }

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

    }

}

  • Flag

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/16/16, 10:55 PM
Seen: 3817 times
Last updated: 8/7/17, 1:37 PM