TYPO3 Reea Blog

This will be shown to users with no Flash or Javascript.

scriptmerger si gzip

Se instaleaza extensia scriptmerger si gzip. Se pune configuratia in aplicare doar cand a fost terminat site-ul si este in productie. Si din htaccess neaparat toata configuratia de sus.

Setting in .htaccess


<FilesMatch "\.js\.gzip$">
AddType "text/javascript" .gzip
</FilesMatch>
<FilesMatch "\.css\.gzip$">
AddType "text/css" .gzip
</FilesMatch>
AddEncoding gzip .gzip



# 3 Month
<filesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
    Header set Cache-Control "max-age=7257600"
</filesMatch>
# 1 Week
<filesMatch "\.(js|css|pdf|txt)$">
    Header set Cache-Control "max-age=604800"
</filesMatch>
# 10 Minutes
<filesMatch "\.(html|htm)$">
    Header set Cache-Control "max-age=600"
</filesMatch>
# NONE
<filesMatch "\.(pl|php|cgi|spl)$">
    Header unset Cache-Control
    Header unset Expires
    Header unset Last-Modified
    FileETag None
    Header unset Pragma
</filesMatch>


#USE THIS FOR EXTENSION scriptmerger
<FilesMatch "\.gz\.(js|css)">
  <IfModule mod_headers.c>
		Header set Content-Encoding gzip
 </IfModule>
</FilesMatch>


#USE THIS FOR gzip extension
RewriteCond  %{REQUEST_FILENAME} .*\.(css|js)$ 
RewriteRule .*  index.php?eID=tx_gzip_output [L] 


Pentru Header Expiration

In config.ts


config.compressJs = 1
config.compressCss = 1

Doar de la typo3v4.6 in sus

Config scriptmerger


plugin.tx_scriptmerger {
  css {
    minify {
      enable = 1
      ignore = \.min\.
    }
    compress {
      enable = 1
      ignore = \.gz\.
    }
    merge {
      enable = 1
      ignore =
    }
  }
  javascript {
      minify {
        enable = 1
        ignore = \?,\.min\.
      }
      compress {
        enable = 1
        ignore = \?,\.gz\.
      }
      merge {
        enable = 1
        ignore = \?
      }
   }
}


blog comments powered by Disqus