2
我們希望能夠建立在Apache的基於用戶代理的Cache-Control頭條件申報的httpd
例如,如果一個用戶代理包含子foo
我們想要的Cache-Control設置爲10分鐘。但如果沒有設置爲1天。
摸索,我發現BrowserMatch
,但似乎只設置環境變量:
BrowserMatch foo short-live # Sets environment variable short-live
不過,我想有條件地應用指令像Header set ...
或ExpiresDefault ...
是否有辦法有條件地申請聲明?例如:
<FilesMatch "\.(jpg|jpeg|gif|png|js|css)$">
Header set Cache-control "max-age=86400"
<IfBrowser "foo">
Header set Cache-control "max-age=600"
</IfBrowser>
</FilesMatch>
注意,IfBrowser
是虛構的。有沒有真正的指令可以像這樣使用?謝謝!
轉貼到http://serverfault.com/questions/261346/contional-declaration-in-apache-httpd因爲缺乏在這裏迴應。 – sligocki 2011-04-19 16:45:06