我正在尝试为特定的URI设置过期头,但由于某种原因它没有起作用。到目前为止,在httpd.conf文件中我所做的是以下内容:
<LocationMatch "/mysite/contentservices/weather/get.json">
ExpiresDefault A86400
</LocationMatch>
<LocationMatch "/mysite/*">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/javascript "access plus 1 day"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
</LocationMatch>
对我来说,这根本行不通。我没有得到指定内容的过期日期标头。我也不明白当你有两个重叠的LocationMatch
指令时会发生什么,第一个指令会优先执行吗?