2011-08-23 31 views
5

मैं अपने httpd.conf में mod_cache, mod_expires, mod_headers मॉड्यूल सक्षम किया है और भी पाठअपाचे कैशिंग जे एस सीएसएस फ़ाइलें

ExpiresActive On 


<ifModule mod_deflate.c> 
    <filesMatch "\.(css|js|x?html?|php)$"> 
    SetOutputFilter DEFLATE 
    </filesMatch> 
</ifModule> 



<ifModule mod_expires.c> 
    ExpiresActive On 
    ExpiresDefault "access plus 1 seconds" 
    ExpiresByType image/x-icon "access plus 2592000 seconds" 
    ExpiresByType image/jpeg "access plus 2592000 seconds" 
    ExpiresByType image/png "access plus 2592000 seconds" 
    ExpiresByType image/gif "access plus 2592000 seconds" 
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" 
    ExpiresByType text/css "access plus 604800 seconds" 
    ExpiresByType text/javascript "access plus 216000 seconds" 
    ExpiresByType application/javascript "access plus 216000 seconds" 
    ExpiresByType application/x-javascript "access plus 216000 seconds" 
    ExpiresByType text/html "access plus 600 seconds" 
    ExpiresByType application/xhtml+xml "access plus 600 seconds" 
</ifModule> 



<ifModule mod_headers.c> 
    <filesMatch "\.(ico|jpe?g|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=216000, public" 
    </filesMatch> 
    <filesMatch "\.(x?html?|php)$"> 
    Header set Cache-Control "max-age=600, public" 
    </filesMatch> 
</ifModule> 



<ifModule mod_headers.c> 
    Header unset ETag 
</ifModule> 
FileETag None 



<ifModule mod_headers.c> 
    Header unset Last-Modifiedd 
</ifModule> 


<IfModule mod_cache.c> 

LoadModule mem_cache_module modules/mod_mem_cache.so 
<IfModule mod_mem_cache.c> 
CacheEnable mem/
MCacheSize 4096 
MCacheMaxObjectCount 100 
MCacheMinObjectSize 1 
MCacheMaxObjectSize 2048 
</IfModule> 
</IfModule> 

लेकिन फ़ाइलों कैशिंग नहीं कर रहे हैं निम्नलिखित गयी। मुझे

Response 
Date Tue, 23 Aug 2011 11:30:09 GMT 
Server Apache/2.2.19 (Win32) PHP/5.3.6 
Last-Modified Mon, 22 Aug 2011 21:24:19 GMT 
Accept-Ranges bytes 
Cache-Control max-age=216000, public 
Expires Thu, 25 Aug 2011 23:30:09 GMT 
Vary Accept-Encoding 
Content-Encoding gzip 
Content-Length 2875 
Keep-Alive timeout=5, max=100 
Connection Keep-Alive 
Content-Type application/javascript 

Request Headers 

Host workflowsf.com 
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 
Accept */* 
Accept-Language en-us,en;q=0.5 
Accept-Encoding gzip, deflate 
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Keep-Alive 115 
Connection keep-alive 

क्या आपको कोई विचार है कि मैं गलत हूं? अग्रिम धन्यवाद

+0

आप कैसे देखते हैं कि फ़ाइलें कैशिंग नहीं हैं? प्रतिक्रिया शीर्षलेख सही लगता है ('कैश-कंट्रोल: अधिकतम आयु = 216000, सार्वजनिक 'की समयसीमा समाप्त होती है: गुरु, 25 अगस्त 2011 23:30:09 GMT') – arnaud576875

+0

जब मुझे फायरबस के नेट टैब के साथ स्थिति दिखाई देती है तो यह मुझे स्थिति 200 दिखाती है। क्या यह सही है? – user704006

उत्तर

1

यह एक काफी अच्छी कॉन्फ़िगरेशन की तरह दिखता है। आपके पास Header unset Last-Modifiedd के साथ एक टाइपो है और आपको शायद पहली पंक्ति की आवश्यकता नहीं है क्योंकि यह <ifModule mod_expires.c> के अंदर लाइन का डुप्लिकेट है और यह इसके लिए एक बेहतर जगह है।

संबंधित मुद्दे