{"id":1902,"date":"2020-10-22T06:05:58","date_gmt":"2020-10-22T06:05:58","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=1902"},"modified":"2025-08-22T04:30:17","modified_gmt":"2025-08-22T04:30:17","slug":"how-to-enable-leverage-browser-caching-in-nginx","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/","title":{"rendered":"How to Enable Leverage Browser Caching in NGINX"},"content":{"rendered":"\n<p>Browser caching improves website speed and performance by storing static content on client browser for future access. This is a great way to render CSS, JS, Image files from client browser without sending request to the web server. Almost every web server allows you to instruct client browsers to cache certain files and data. But this setting is turned off by default. Are you wondering how to cache static content in NGINX? Here are the steps to enable leverage browser caching in NGINX.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#What_is_Browser_Caching\" >What is Browser Caching<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Enable_Leverage_Browser_Caching_in_NGINX\" >Enable Leverage Browser Caching in NGINX<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#1_Open_NGINX_Server_configuration\" >1. Open NGINX Server configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#2_Enable_Leverage_Browser_Caching\" >2. Enable Leverage Browser Caching<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Cache_Specific_Location\" >Cache Specific Location<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Cache_Specific_File_Types\" >Cache Specific File Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Cache_Entire_Server\" >Cache Entire Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Cache_All_Servers_in_HTTP_Block\" >Cache All Servers in HTTP Block<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#3_Restart_NGINX_Server\" >3. Restart NGINX Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Browser_Caching\"><\/span>What is Browser Caching<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Every web browser has a small database that it uses to store frequently requested files and data. For example, it generally caches static files such as CSS, JS, HTML, etc. as well as images, videos and more. It allows web browsers to load certain files without requesting them to remote web server. This improves website speed and performance. However, it is generally done by web browser&#8217;s internal algorithms that determine what content needs to be cached. Using web server such as NGINX server, you can control which content needs to be cached. It is done by setting certain response headers which tell the web browser to store the response&#8217;s files and data for later use. This is very useful in improving website speed and reducing server bandwidth.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Enable_Leverage_Browser_Caching_in_NGINX\"><\/span>Enable Leverage Browser Caching in NGINX<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s how to enable leverage <a href=\"https:\/\/pressidium.com\/blog\/browser-cache-work\/\">browser caching<\/a> in NGINX.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_NGINX_Server_configuration\"><\/span>1. Open NGINX Server configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open terminal and run the following command to open NGINX server configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/nginx\/nginx.conf<\/pre>\n\n\n\n<p>If you have configured separate virtual hosts for your website (e.g www.example.com), such as \/etc\/nginx\/sites-enabled\/website.conf then open its configuration with the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi&nbsp;\/etc\/nginx\/sites-enabled\/website.conf<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Enable_Leverage_Browser_Caching\"><\/span>2. Enable Leverage Browser Caching<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Add the following 3 lines in your NGINX server configuration file to cache static content in NGINX<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">expires 30d;\nadd_header Pragma \"public\";\nadd_header Cache-Control \"public\";<\/pre>\n\n\n\n<p>The first line instructs NGINX to cache content in client browser for 30 days (30d). You can change this cache duration as per your requirement. After this period, any new request from user will result in cache re-validation and update from the client browser.<\/p>\n\n\n\n<p>The next couple of lines are used to set cache related headers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cache_Specific_Location\"><\/span>Cache Specific Location<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can place the above lines in <em>location<\/em>, <em>server<\/em> or <em>http<\/em> blocks. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location \/static\/ {\n expires 30d;\n add_header Pragma \"public\";\n add_header Cache-Control \"public\";\n}<\/pre>\n\n\n\n<p>When you place them in location block, only the content served by that location will be cached. In the above case, only requests to \/static\/ will be cached.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cache_Specific_File_Types\"><\/span>Cache Specific File Types<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to cache specific file types, you can do so using location block.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location ~* \\.(js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|woff|woff2|svg)$ {\n expires 30d;\n add_header Pragma \"public\";\n add_header Cache-Control \"public\";\n}<\/pre>\n\n\n\n<p>In the above example, we are caching various file types such as js, jpg, css, etc.<\/p>\n\n\n\n<p>Bonus Read : <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-status-page\/\">How to Enable NGINX Status Page<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cache_Entire_Server\"><\/span>Cache Entire Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Similarly, you can place cache configuration in server block before any location block. In this case, all responses from this server will be cached.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n ...\n expires 30d;\n add_header Pragma \"public\";\n add_header Cache-Control \"public\";\n ...\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cache_All_Servers_in_HTTP_Block\"><\/span>Cache All Servers in HTTP Block<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can may also place the cache configuration in <em>http<\/em> block, before any <em>server<\/em> block.<\/p>\n\n\n\n<pre id=\"block-b8ae6152-8ecb-406a-a7f8-5e8ae8b2a5d2\" class=\"wp-block-preformatted\">http {\n ...\n expires 30d;\n add_header Pragma \"public\";\n add_header Cache-Control \"public\";\n ...\n}<\/pre>\n\n\n\n<p>In this case, all server requests supported by the configuration file will be cached.<\/p>\n\n\n\n<p>Typically, websites cache content from a specific folder, or having specific file extensions, using <em>location<\/em> block.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_NGINX_Server\"><\/span>3. Restart NGINX Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Run the following command to check syntax of your updated config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nginx -t<\/pre>\n\n\n\n<p>If there are no errors, run the following command to restart NGINX server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo service nginx reload #debian\/ubuntu<br>$ systemctl restart nginx #redhat\/centos<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Hopefully, this article will help you enable leverage browser caching in NGINX. In this article, we have learnt how to enable browser caching in NGINX server. Every web server this setting that can be turned on by site administrators. Web browser caching is a great way to load pages quickly and reduce server load. When a user requests a web page, its cached contents are directly loaded from web browser without sending the request to server. Only, its non-cached files and data are loaded from web server.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-nginx-status-page\/\">How to Enable NGINX Status Page<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/install-varnish-cache-nginx-centos\/\">How to Install Varnish Cache in Apache<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/nginx-ssl-configuration-step-step-details\/\">NGINX SSL Configuration Step by Step<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Browser Caching improves website speed and performance. Here&#8217;s how to enable leverage browser caching in NGINX.<\/p>\n","protected":false},"author":1,"featured_media":1914,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[203],"class_list":["post-1902","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-browser-caching"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Enable Leverage Browser Caching in NGINX - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Are you wondering how to cache static content in NGINX? Here&#039;s how to enable leverage browser caching in NGINX.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Enable Leverage Browser Caching in NGINX - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Are you wondering how to cache static content in NGINX? Here&#039;s how to enable leverage browser caching in NGINX.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-22T06:05:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-22T04:30:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1460\" \/>\n\t<meta property=\"og:image:height\" content=\"730\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Enable Leverage Browser Caching in NGINX\",\"datePublished\":\"2020-10-22T06:05:58+00:00\",\"dateModified\":\"2025-08-22T04:30:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/\"},\"wordCount\":660,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1\",\"keywords\":[\"browser caching\"],\"articleSection\":[\"Nginx\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/\",\"name\":\"How to Enable Leverage Browser Caching in NGINX - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1\",\"datePublished\":\"2020-10-22T06:05:58+00:00\",\"dateModified\":\"2025-08-22T04:30:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Are you wondering how to cache static content in NGINX? Here's how to enable leverage browser caching in NGINX.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1\",\"width\":1460,\"height\":730,\"caption\":\"enable leverage browser cache in nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-enable-leverage-browser-caching-in-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable Leverage Browser Caching in NGINX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Enable Leverage Browser Caching in NGINX - Ubiq BI","description":"Are you wondering how to cache static content in NGINX? Here's how to enable leverage browser caching in NGINX.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Enable Leverage Browser Caching in NGINX - Ubiq BI","og_description":"Are you wondering how to cache static content in NGINX? Here's how to enable leverage browser caching in NGINX.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-10-22T06:05:58+00:00","article_modified_time":"2025-08-22T04:30:17+00:00","og_image":[{"width":1460,"height":730,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png","type":"image\/png"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Enable Leverage Browser Caching in NGINX","datePublished":"2020-10-22T06:05:58+00:00","dateModified":"2025-08-22T04:30:17+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/"},"wordCount":660,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1","keywords":["browser caching"],"articleSection":["Nginx"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/","name":"How to Enable Leverage Browser Caching in NGINX - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1","datePublished":"2020-10-22T06:05:58+00:00","dateModified":"2025-08-22T04:30:17+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Are you wondering how to cache static content in NGINX? Here's how to enable leverage browser caching in NGINX.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1","width":1460,"height":730,"caption":"enable leverage browser cache in nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-enable-leverage-browser-caching-in-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Enable Leverage Browser Caching in NGINX"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/10\/how-to-leverage-nginx-browser-cache.png?fit=1460%2C730&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-uG","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=1902"}],"version-history":[{"count":25,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":9257,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/1902\/revisions\/9257"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/1914"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}