安裝了mod_expires,設置了htaccess,怎麼還顯示no-expires?
Server: Apache/1.3.41 (Unix)
安裝了mod_expires
在網站根目錄添加了文件.htaccess
.htaccess內容如下
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 12 hours"
ExpiresByType text/html "access plus 3 days"
ExpiresByType text/plain "access plus 3 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/x-icon "access plus 30 days"
</IfModule>
但是瀏覽網站時顯示還是沒有no-expires
這是怎麼回事啊?還要做些什麼呢?
謝謝
《解決方案》
如果把<IfModule mod_expires.c></IfModule>這對去掉就會報如下錯誤
.htaccess: Invalid command 'ExpiresActive', perhaps mis-spelled or defined by a module not included in the server configuration
《解決方案》
有age或max-age嗎?
帖報頭看看
《解決方案》
你如何得知no-expires?
《解決方案》
沒有有age或max-age
我是用httpWatch和yslow檢測的
謝謝
HTTP/1.0 304
Date: Thu, 23 Jul 2009 04:34:34 GMT
Content-Type: application/x-javascript
Last-Modified: Tue, 14 Jul 2009 14:47:22 GMT
Age: 3098
X-Cache: HIT from localhost
Via: 1.0 localhost (squid/3.0.STABLE16)
Proxy-Connection: keep-alive
《解決方案》
原帖由 sanjianghong 於 2009-7-23 15:20 發表 http://bbs3.chinaunix.net/images/common/back.gif
HTTP/1.0 304
Date: Thu, 23 Jul 2009 04:34:34 GMT
Content-Type: application/x-javascript
Last-Modified: Tue, 14 Jul 2009 14:47:22 GMT
Age: 3098
X-Cache: HIT from localhost
Via: 1.0 localhost (squid/3.0.STABLE16)
Proxy-Connection: keep-alive
應該是生效了,你不要通過squid直接請求看看
《解決方案》
"應該是生效了"?
從附件中看到過期時間沒有設置;
「你不要通過squid直接請求看看」
怎麼直接看啊?我現在看咱們這個論壇顯示的也是有這個:
HTTP/1.0 304 Not Modified
Date: Thu, 23 Jul 2009 08:03:55 GMT
Server: Apache/2.0.63 (Unix) PHP/5.2.6
ETag: "30f18e8-3f7-9fa452c0"
X-Cache: MISS from localhost
Via: 1.0 localhost (squid/3.0.STABLE16)
Proxy-Connection: keep-alive
《解決方案》
下面這個有expires設置