
How to Enable Browser Caching in WordPress Hosted on Nginx Server-: Every time a browser loads a webpage it has to download all the web files to properly display the page. This includes all the HTML, CSS, JavaScript and images. Some pages might only consist of a few files and be small in size – maybe a couple of kilobytes. For others however there may be a lot of files, and these may add up to be several megabytes large. Twitter.com, for example, is 3 MB+.
What is Browser Caching-:
Browser caching works by marking certain pages, or parts of pages, as being needed to be updated at different intervals. Your logo on your website, for instance, is unlikely to change from day today. By caching this logo image, we can tell the user’s browser to only download this image once a week.
Every visit that user makes within a week would not require another download of the logo image. By the web server telling the browser to store these files and not download them when you come back saves your users time and your web server bandwidth.
How to Enable Browser Caching in WordPress Hosted on Nginx Server-:
You can enable Leverage Browser Caching via the settings page of WP Fastest Cache for Apache servers but You cannot be enabled Leverage Browser Caching for the Nginx servers so you have to enable it manually. You need to add the following code into /etc/nginx/nginx.conf to enable Leverage Browser Caching on Nginx servers.
location ~* \.(css|js|ico|gif|jpeg|jpg|webp|png|svg|eot|otf|woff|woff2|ttf|ogg)$ { expires max; }
Thanks for reading…“Pardon my grammar, English is not my native tongue.”
If you like my work, Please Share on Social Media! You can Follow WP knol on Facebook, Twitter, Pinterest and YouTube for latest updates. You may Subscribe to WP Knol Newsletter to get latest updates via Email. You May also Continue Reading my Recent Posts Which Might Interest You.