{"id":726,"date":"2017-11-13T15:51:41","date_gmt":"2017-11-13T15:51:41","guid":{"rendered":"http:\/\/sls.gmu.edu\/web\/?p=726"},"modified":"2017-11-13T15:53:14","modified_gmt":"2017-11-13T15:53:14","slug":"force-update-of-pdfs","status":"publish","type":"post","link":"https:\/\/sls.gmu.edu\/web\/2017\/11\/13\/force-update-of-pdfs\/","title":{"rendered":"Force Update of PDFs"},"content":{"rendered":"<p>When replacing an existing PDF, browsers don\u2019t serve the latest version. They usually serve the cached version. To change that, we use Apache directives as below:<\/p>\n<p><code># Instruct browsers to always check for the latest version of your files using Apache directives<br \/>\n&lt;IfModule mod_headers.c&gt;<br \/>\n\t&lt;FilesMatch &quot;(?i)^.*\\.(css|htm|html|gif|jpg|jpeg|js|png|pdf)$&quot;&gt;<br \/>\n\t\tHeader set Cache-Control &quot;max-age=0,must-revalidate&quot;<br \/>\n\t&lt;\/FilesMatch&gt;<br \/>\n&lt;\/IfModule&gt;<\/code><\/p>\n<p>The instruction above includes more than just PDF.<\/p>\n<p>Another solution is using <code>?ver=x.x<\/code> in the URL. For example:<\/p>\n<p><code>https:\/\/www.law.gmu.edu\/assets\/css\/2015\/style.css?ver=2.0 <\/code><\/p>\n<p><code>x.x<\/code> could be any number. <\/p>\n<p>Source: \u201c<a href=\"https:\/\/immense.net\/force-update-cached-files-images-favicon\/\">How to force an update of cached files, images, favicon<\/a>\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When replacing an existing PDF, browsers don\u2019t serve the latest version. They usually serve the cached version. To change that, we use Apache directives as below: # Instruct browsers to always check for the latest version of your files using Apache directives &lt;IfModule mod_headers.c&gt; &lt;FilesMatch &quot;(?i)^.*\\.(css|htm|html|gif|jpg|jpeg|js|png|pdf)$&quot;&gt; Header set Cache-Control &quot;max-age=0,must-revalidate&quot; &lt;\/FilesMatch&gt; &lt;\/IfModule&gt; The instruction above &hellip; <a href=\"https:\/\/sls.gmu.edu\/web\/2017\/11\/13\/force-update-of-pdfs\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Force Update of PDFs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-726","post","type-post","status-publish","format-standard","hentry","category-web-development"],"_links":{"self":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":0,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"wp:attachment":[{"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sls.gmu.edu\/web\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}