Jumat, 13 Juni 2014

Meningkatkan "Specify a cache validator" di gtmetrix

Silahkan di tuliskan code dibawah untuk di .htaccess :
<IfModule mod_expires.c>
ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 year"

# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 1 month"

# Your document html
ExpiresByType text/html "access plus 1 month"

# Data
ExpiresByType text/xml "access plus 1 month"
ExpiresByType application/xml "access plus 1 month"
ExpiresByType application/json "access plus 1 month"

# RSS feed
ExpiresByType application/rss+xml "access plus 1 month"

# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 month"

# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"

# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"

# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"

<IfModule mod_headers.c>

##### DYNAMIC PAGES
<FilesMatch "\\.(ast|php|css|js)$">
Header set Cache-Control "public, max-age=3600, must-revalidate"
</FilesMatch>

##### STATIC FILES
<FilesMatch "\\.(png|svg|swf|js|xml|css|js)$">
Header set Cache-Control "public, max-age=604800, must-revalidate"
</FilesMatch>
</IfModule>

##### ETERNAL FILES
<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|html|pdf)$">
Header set Cache-Control "max-age=20082014, private, must-revalidate"
FileETag None
</FilesMatch>

====================================================

 

Tidak ada komentar:

Posting Komentar

Cara mengecek encyrp MD5 aman atau tidak

haloooo .......... password anda aman atau encyrpsi menggunakan md5 anda sudah aman? Google dorking, sudah tau? misalnya menggunakan wordpre...