Jump to content

.htaccess


Manol
 Share

Recommended Posts

Hello.

    I'm trying to speed  a phone webpage by setting expires headers in the htaccess file like this:

... all processwire htaccess settings ....

#################################################################################################
# END PROCESSWIRE HTACCESS DIRECTIVES
#################################################################################################

</IfModule>


<IfModule mod_expires.c>

ExpiresActive On
ExpiresDefault "access plus 1 month"

ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"

ExpiresByType image/x-icon "access plus 1 year"

ExpiresByType text/css "access plus 2 months"
</IfModule>

but when I check my webpage whit YSlow I get the following results ( snapshot in the attached file):

Grade E on Add Expires headers

There are 4 static components without a far-future expiration date.

as you can see the .css files have a expire date of today not two months as intended and the forth has 1981 expire  date, when is supposed to be 1 month form access (today 2013/6/11).

I'm using a 1and dynamic cloud server centos 6.

Thanks in advance to everybody!

post-1191-0-17657100-1370966079_thumb.pn

Link to comment
Share on other sites

what.i use this is

good it does.work

top {not buttock}, of  htaccess u

will.put it . enjoy

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/octet-stream "access plus 1 month"
  ExpiresByType application/x-javascript "access plus 1 month"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$">
    Header set Cache-Control "max-age=31536000, public"
  </FilesMatch>
  <FilesMatch "\\.(css)$">
    Header set Cache-Control "max-age=2692000, public"
  </FilesMatch>
  <FilesMatch "\\.(js)$">
    Header set Cache-Control "max-age=2692000, private"
  </FilesMatch>
  <FilesMatch "\.(js|css|xml|gz)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
  Header unset ETag
  Header append Cache-Control "public"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilter DEFLATE js css
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
 
  • Like 12
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...

what.i use this is

good it does.work

top {not buttock}, of  htaccess u

will.put it . enjoy

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/octet-stream "access plus 1 month"
  ExpiresByType application/x-javascript "access plus 1 month"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$">
    Header set Cache-Control "max-age=31536000, public"
  </FilesMatch>
  <FilesMatch "\\.(css)$">
    Header set Cache-Control "max-age=2692000, public"
  </FilesMatch>
  <FilesMatch "\\.(js)$">
    Header set Cache-Control "max-age=2692000, private"
  </FilesMatch>
  <FilesMatch "\.(js|css|xml|gz)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
  Header unset ETag
  Header append Cache-Control "public"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilter DEFLATE js css
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
 

I found that the header Expires always is Thu, 19 Nov 1981 08:52:00 GMT

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...