{"id":1587,"date":"2010-09-13T15:08:20","date_gmt":"2010-09-13T09:38:20","guid":{"rendered":"https:\/\/2thenew.xyz\/blog\/?p=1587"},"modified":"2016-12-19T15:06:26","modified_gmt":"2016-12-19T09:36:26","slug":"setting-expires-http-header-on-server-response-through-apache","status":"publish","type":"post","link":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/","title":{"rendered":"Setting Expires HTTP header on server response through Apache"},"content":{"rendered":"<p>In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already.<br \/>\nThe module that control it is <strong>&#8220;mod_expires.c&#8221;<\/strong>. This module is not enabled by default.<br \/>\nYou need to enable it by following command (You need to be sudo user):<\/p>\n<pre lang=\"groovy\">a2enmod {module name} \/\/here module name is \"expires\"<\/pre>\n<p>Then, open your site configuration file available at apache2\/sites-available\/{your site}<br \/>\n<\/p>\n<p>Append following xml entries in your site configuration file :<\/p>\n<pre lang=\"groovy\">\r\n<IfModule mod_expires.c>\r\n      <FilesMatch \"\\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$\">\r\n          ExpiresActive On\r\n          ExpiresDefault \"access plus 2 days\"\r\n      <\/FilesMatch>\r\n<\/IfModule>\r\n<\/pre>\n<p>ExpiresDefault Syntax :<\/p>\n<pre lang=\"groovy\">ExpiresDefault \"{base} [plus] {num  type}*\"<\/pre>\n<p><strong>Note :<\/strong> Here base is : &#8216;access&#8217; and the type is : &#8216;years&#8217;, &#8216;months&#8217;, &#8216;weeks&#8217;, &#8216;days&#8217;, &#8216;hours&#8217;, &#8216;minutes&#8217;, &#8216;seconds&#8217;<br \/>\n<\/p>\n<p>You can also use &#8220;ExpiresByType&#8221; for setting different expires for different file type instead of &#8220;ExpiresDefault&#8221;.<br \/>\nHope this code will help \ud83d\ude42<br \/>\n<br \/>\nRegards,<br \/>\nTarun Pareek<br \/>\nIntelligrape Software<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &#8220;mod_expires.c&#8221;. This module is not enabled by default. You need to enable [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":15,"footnotes":""},"categories":[1],"tags":[18,389,391,390],"class_list":["post-1587","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apache","tag-expires-http-header","tag-expiresbytype","tag-expiresdefault"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &quot;mod_expires.c&quot;. This module is not enabled by default. You need to enable\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Tarun Pareek\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &quot;mod_expires.c&quot;. This module is not enabled by default. You need to enable\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &quot;mod_expires.c&quot;. This module is not enabled by default. You need to enable\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#article\",\"name\":\"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog\",\"headline\":\"Setting Expires HTTP header on server response through Apache\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/tarun\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2010-09-13T15:08:20+05:30\",\"dateModified\":\"2016-12-19T15:06:26+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#webpage\"},\"articleSection\":\"Technology, apache, Expires HTTP header, ExpiresByType, ExpiresDefault\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#listItem\",\"name\":\"Setting Expires HTTP header on server response through Apache\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#listItem\",\"position\":3,\"name\":\"Setting Expires HTTP header on server response through Apache\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/tarun\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/tarun\\\/\",\"name\":\"Tarun Pareek\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/0a83bd26-2bc9-45ee-9557-a0a9d3dce30d_446-Tarun-Pareek-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Tarun Pareek\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/\",\"name\":\"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog\",\"description\":\"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is \\\"mod_expires.c\\\". This module is not enabled by default. You need to enable\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/setting-expires-http-header-on-server-response-through-apache\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/tarun\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/tarun\\\/#author\"},\"datePublished\":\"2010-09-13T15:08:20+05:30\",\"dateModified\":\"2016-12-19T15:06:26+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog","description":"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is \"mod_expires.c\". This module is not enabled by default. You need to enable","canonical_url":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#article","name":"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog","headline":"Setting Expires HTTP header on server response through Apache","author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/tarun\/#author"},"publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"},"datePublished":"2010-09-13T15:08:20+05:30","dateModified":"2016-12-19T15:06:26+05:30","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#webpage"},"articleSection":"Technology, apache, Expires HTTP header, ExpiresByType, ExpiresDefault"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.xyz\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/2thenew.xyz\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#listItem","name":"Setting Expires HTTP header on server response through Apache"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#listItem","position":3,"name":"Setting Expires HTTP header on server response through Apache","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.xyz\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.xyz\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.xyz\/blog\/author\/tarun\/#author","url":"https:\/\/2thenew.xyz\/blog\/author\/tarun\/","name":"Tarun Pareek","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/0a83bd26-2bc9-45ee-9557-a0a9d3dce30d_446-Tarun-Pareek-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Tarun Pareek"}},{"@type":"WebPage","@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#webpage","url":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/","name":"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog","description":"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is \"mod_expires.c\". This module is not enabled by default. You need to enable","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/tarun\/#author"},"creator":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/tarun\/#author"},"datePublished":"2010-09-13T15:08:20+05:30","dateModified":"2016-12-19T15:06:26+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.xyz\/blog\/#website","url":"https:\/\/2thenew.xyz\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog","og:description":"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &quot;mod_expires.c&quot;. This module is not enabled by default. You need to enable","og:url":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/","og:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Setting Expires HTTP header on server response through Apache | TO THE NEW Blog","twitter:description":"In recent poc, i have set the expires HTTP header on server response for one of the project, such that it will again set when access by user for the specified period, if header is expired already. The module that control it is &quot;mod_expires.c&quot;. This module is not enabled by default. You need to enable","twitter:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"1587","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 08:16:01","updated":"2024-02-29 08:26:26","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSetting Expires HTTP header on server response through Apache\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.xyz\/blog"},{"label":"Technology","link":"https:\/\/2thenew.xyz\/blog\/category\/technology\/"},{"label":"Setting Expires HTTP header on server response through Apache","link":"https:\/\/2thenew.xyz\/blog\/setting-expires-http-header-on-server-response-through-apache\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/1587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/comments?post=1587"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/1587\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/media?parent=1587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/categories?post=1587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/tags?post=1587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}