Leverage browser take the literal meaning of making the browser cache resources by the exertion of force by means of a lever, which is the server. Although process of caching differs based on the server you use ( Nginx, Apache, etc .) the concept remains the same all over, server only changed content or download what has changed.

Caching settings are to be done in the sites configuration file, it’s not possible to set the caching inside a directory like in Apache.

Open the configuration file for the domain inside /etc/nginx/sites-available, if you use the default configuration then it’s default file.

Open it up in your favorite editor. Now inside the server block insert the following code.

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

If you use multiple sites add this into the configuration file of each and make sure to give the nginx a restart. You have the lever set to cache 😀