<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add Expires headers]]></title><description><![CDATA[<p dir="auto">Buona sera atutti carissimi. Non riesto a validare correttamente la pagina su GTMETRIX il quale mi restiusce 0 per Add Expires headers. Qualcuno mi può aiutare a capire cosìè che blocca?</p>
<p dir="auto">Sto usando wordpress su hosting Aruba e Pannello Plesk su server Cloud sempre Aruba. Dopo aver settato Apache &amp; nginx al quale ho aggiunto le seguenti direttive per http e https:<br />
&lt;filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;<br />
Header set Cache-Control "max-age=2592000, public"<br />
&lt;/filesMatch&gt;</p>
<p dir="auto">&lt;IfModule mod_expires.c&gt;<br />
ExpiresActive On<br />
ExpiresByType image/jpg "access 1 year"<br />
ExpiresByType image/jpeg "access 1 year"<br />
ExpiresByType image/gif "access 1 year"<br />
ExpiresByType image/png "access 1 year"<br />
ExpiresByType text/css "access 1 month"<br />
ExpiresByType application/pdf "access 1 month"<br />
ExpiresByType text/x-javascript "access 1 month"<br />
ExpiresByType application/x-shockwave-flash "access 1 month"<br />
ExpiresByType image/x-icon "access 1 year"<br />
ExpiresDefault "access 2 days"<br />
&lt;/IfModule&gt;</p>
<p dir="auto">e Additional nginx directives</p>
<p dir="auto">gzip on;<br />
gzip_disable "MSIE [1-6]\.(?!.*SV1)";<br />
gzip_proxied any;<br />
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml;<br />
gzip_vary on;</p>
<p dir="auto">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)$ {<br />
etag on;<br />
if_modified_since exact;<br />
add_header Pragma "public";<br />
add_header Cache-Control "max-age=31536000, public";<br />
}<br />
<strong>Questo invece è il file .htaccess che ho fatto</strong></p>
<h1>Use UTF-8 encoding for anything served text/plain or text/html</h1>
<p dir="auto">AddDefaultCharset UTF-8</p>
<h1>Force UTF-8 for a number of file formats</h1>
<p dir="auto">&lt;IfModule mod_mime.c&gt;<br />
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml<br />
&lt;/IfModule&gt;</p>
<h1>FileETag None is not enough for every server.</h1>
<p dir="auto">&lt;IfModule mod_headers.c&gt;<br />
Header unset ETag<br />
&lt;/IfModule&gt;</p>
<h1>Since we’re sending far-future expires, we don’t need ETags for static content.</h1>
<h1><a href="http://developer.yahoo.com/performance/rules.html#etags" rel="nofollow ugc">developer.yahoo.com/performance/rules.html#etags</a></h1>
<p dir="auto">FileETag None</p>
<h1>Send CORS headers if browsers request them; enabled by default for images.</h1>
<p dir="auto">&lt;IfModule mod_setenvif.c&gt;<br />
&lt;IfModule mod_headers.c&gt;</p>
<h1>mod_headers, y u no match by Content-Type?!</h1>
<p dir="auto">&lt;FilesMatch ".(cur|gif|png|jpe?g|svgz?|ico|webp)$"&gt;<br />
SetEnvIf Origin ":" IS_CORS<br />
Header set Access-Control-Allow-Origin "*" env=IS_CORS<br />
&lt;/FilesMatch&gt;<br />
&lt;/IfModule&gt;<br />
&lt;/IfModule&gt;</p>
<h1>Allow access to web fonts from all domains.</h1>
<p dir="auto">&lt;FilesMatch ".(eot|otf|tt[cf]|woff2?)$"&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
Header set Access-Control-Allow-Origin "*"<br />
&lt;/IfModule&gt;<br />
&lt;/FilesMatch&gt;</p>
<p dir="auto">&lt;IfModule mod_alias.c&gt;<br />
&lt;FilesMatch ".(html|htm|rtf|rtx|txt|xsd|xsl|xml)$"&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
Header set X-Powered-By "WP Rocket/2.10.6"<br />
Header unset Pragma<br />
Header append Cache-Control "public"<br />
Header unset Last-Modified<br />
&lt;/IfModule&gt;<br />
&lt;/FilesMatch&gt;</p>
<p dir="auto">&lt;FilesMatch ".(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$"&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
Header unset Pragma<br />
Header append Cache-Control "public"<br />
&lt;/IfModule&gt;<br />
&lt;/FilesMatch&gt;<br />
&lt;/IfModule&gt;</p>
<h1>Expires headers (for better cache control)</h1>
<p dir="auto">&lt;IfModule mod_expires.c&gt;<br />
ExpiresActive on</p>
<h1>Perhaps better to whitelist expires rules? Perhaps.</h1>
<p dir="auto">ExpiresDefault                          "access plus 1 month"</p>
<h1>cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)</h1>
<p dir="auto">ExpiresByType text/cache-manifest       "access plus 0 seconds"</p>
<h1>Your document html</h1>
<p dir="auto">ExpiresByType text/html                 "access plus 0 seconds"</p>
<h1>Data</h1>
<p dir="auto">ExpiresByType text/xml                  "access plus 0 seconds"<br />
ExpiresByType application/xml           "access plus 0 seconds"<br />
ExpiresByType application/json          "access plus 0 seconds"</p>
<h1>Feed</h1>
<p dir="auto">ExpiresByType application/rss+xml       "access plus 1 hour"<br />
ExpiresByType application/atom+xml      "access plus 1 hour"</p>
<h1>Favicon (cannot be renamed)</h1>
<p dir="auto">ExpiresByType image/x-icon              "access plus 1 week"</p>
<h1>Media: images, video, audio</h1>
<p dir="auto">ExpiresByType image/gif                 "access plus 1 month"<br />
ExpiresByType image/png                 "access plus 1 month"<br />
ExpiresByType image/jpeg                "access plus 1 month"<br />
ExpiresByType video/ogg                 "access plus 1 month"<br />
ExpiresByType audio/ogg                 "access plus 1 month"<br />
ExpiresByType video/mp4                 "access plus 1 month"<br />
ExpiresByType video/webm                "access plus 1 month"</p>
<h1>HTC files  (css3pie)</h1>
<p dir="auto">ExpiresByType text/x-component          "access plus 1 month"</p>
<h1>Webfonts</h1>
<p dir="auto">ExpiresByType application/x-font-ttf    "access plus 1 month"<br />
ExpiresByType font/opentype             "access plus 1 month"<br />
ExpiresByType application/x-font-woff   "access plus 1 month"<br />
ExpiresByType application/x-font-woff2  "access plus 1 month"<br />
ExpiresByType image/svg+xml             "access plus 1 month"<br />
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"</p>
<h1>CSS and JavaScript</h1>
<p dir="auto">ExpiresByType text/css                  "access plus 1 year"<br />
ExpiresByType application/javascript    "access plus 1 year"</p>
<p dir="auto">&lt;/IfModule&gt;</p>
<h1>Gzip compression</h1>
<p dir="auto">&lt;IfModule mod_deflate.c&gt;</p>
<h1>Active compression</h1>
<p dir="auto">SetOutputFilter DEFLATE</p>
<h1>Force deflate for mangled headers</h1>
<p dir="auto">&lt;IfModule mod_setenvif.c&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding<br />
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding</p>
<h1>Don’t compress images and other uncompressible content</h1>
<p dir="auto">SetEnvIfNoCase Request_URI <br />
.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp)$ no-gzip dont-vary<br />
&lt;/IfModule&gt;<br />
&lt;/IfModule&gt;</p>
<h1>Compress all output labeled with one of the following MIME-types</h1>
<p dir="auto">&lt;IfModule mod_filter.c&gt;<br />
AddOutputFilterByType DEFLATE application/atom+xml <br />
application/javascript <br />
application/json <br />
application/rss+xml <br />
application/vnd.ms-fontobject <br />
application/x-font-ttf <br />
application/xhtml+xml <br />
application/xml <br />
font/opentype <br />
image/svg+xml <br />
image/x-icon <br />
text/css <br />
text/html <br />
text/plain <br />
text/x-component <br />
text/xml<br />
&lt;/IfModule&gt;<br />
&lt;IfModule mod_headers.c&gt;<br />
Header append Vary: Accept-Encoding<br />
&lt;/IfModule&gt;<br />
&lt;/IfModule&gt;</p>
<h1>BEGIN Far Future Expiration Plugin</h1>
<p dir="auto">&lt;IfModule mod_expires.c&gt;<br />
ExpiresActive on<br />
&lt;FilesMatch ".(gif|jpeg|jpg|png|ico|js|css|swf)$"&gt;<br />
ExpiresDefault "access plus 5 days"<br />
&lt;/FilesMatch&gt;<br />
&lt;/IfModule&gt;</p>
<h1>END Far Future Expiration Plugin</h1>
<h1>BEGIN WordPress</h1>
<p dir="auto">&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^index.php$ - [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;</p>
<h1>END WordPress</h1>
]]></description><link>https://dev.connect.gt/topic/237588/add-expires-headers</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 00:23:10 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/237588.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Mar 2019 18:58:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add Expires headers on Sun, 24 Mar 2019 11:33:13 GMT]]></title><description><![CDATA[<p dir="auto">Nessuno ha avuto lo stesso problema?</p>
]]></description><link>https://dev.connect.gt/post/1256418</link><guid isPermaLink="true">https://dev.connect.gt/post/1256418</guid><dc:creator><![CDATA[colvi]]></dc:creator><pubDate>Sun, 24 Mar 2019 11:33:13 GMT</pubDate></item></channel></rss>