这是.htaccess
我从互联网上窃取并稍作调整的文件中的一部分
<ifModule mod_headers.c>
Header set Connection keep-alive
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=86400, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=86400, private, must-revalidate"
</filesMatch>
</ifModule>
我在我的 statik 博客上使用它。我想以index.html
不同的方式处理文件并将 max-age 设置为 3600。但我不知道.htaccess
文件的工作原理。