Provides various official and user-released code examples. For code reference, you are welcome to learn how to use. htaccess to set website compression and cache.
Original reprinted address: http://www.jb100.net/html/content-22-738-1.html
Add the following code to the. htaccess file under the root directory of the website
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
ExpiresByType application/x-shockwave-flash A2592000
ExpiresByType text/css A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType text/javascript A2592000
ExpiresByType text/html A600
SetOutputFilter DEFLATE
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
Header unset Last-Modified
FileETag none
Put it in the. htaccess file under the root directory of your website or blog.
Original reprinted address: http://www.jb100.net/html/content-22-738-1.html
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB