2014-09-14 3 views
1

Google PageSpeed Insights을 사용하여 웹 사이트의 속도를 향상시키고 있습니다 - www.edmhunters.com..htaccess 규칙은 일부 페이지에서는 작동하지만 다른 페이지에서는 작동하지 않습니다.

우선, 여기에 Cache-Control 헤더는 이상하게 미디어 파일과 정적 파일이 아니라 단지 노력하고 있습니다

# ----------------------------------------------------------------------- 
# Caching for 1 Year 
# ----------------------------------------------------------------------- 
<FilesMatch "\.(ico|svg|woff|eot|ttf)$"> 
Header set Cache-Control "max-age=31536000, public" 
</FilesMatch> 

# ----------------------------------------------------------------------- 
# Caching for 1 Week 
# ----------------------------------------------------------------------- 
<FilesMatch "\.(jpg|png|gif|css|js)$"> 
Header set Cache-Control "max-age=604800, public" 
</FilesMatch> 

# ----------------------------------------------------------------------- 
# Defining MIME types to ensure the web server actually knows about them 
# ----------------------------------------------------------------------- 
<IfModule mod_mime.c> 
    AddType application/javascript   js 
    AddType application/vnd.ms-fontobject eot 
    AddType application/x-font-ttf   ttf ttc 
    AddType font/opentype     otf 
    AddType application/x-font-woff   woff 
    AddType image/svg+xml     svg svgz 
    AddEncoding gzip      svgz 
</Ifmodule> 

# ----------------------------------------------------------------------- 
# Compressing output 
# ----------------------------------------------------------------------- 
<IfModule mod_deflate.c> 
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json 
    AddOutputFilterByType DEFLATE application/javascript 
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component 
    AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml 
    AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype 
</Ifmodule> 

처럼 내 .htaccess 파일이 모습입니다.

예 : http://www.edmhunters.com/static/img/bp-logo.9bf55788f1b6.jpg의 출력이 보이지만 redbot.org에 http://www.edmhunters.com/media/dj/images/deadmau5_2.jpg의 출력이

HTTP/1.1 200 OK 
    Date: Sun, 14 Sep 2014 06:01:54 GMT 
    Server: Apache/2.4.7 (Ubuntu) 
    Last-Modified: Thu, 11 Sep 2014 13:52:29 GMT 
    ETag: "7391-502ca7aba5a6e" 
    Accept-Ranges: bytes 
    Content-Length: 29585 
    Cache-Control: max-age=604800, public 
    Keep-Alive: timeout=5, max=100 
    Connection: Keep-Alive 
    Content-Type: image/jpeg 

처럼 보이는이

HTTP/1.1 200 OK 
    Date: Sun, 14 Sep 2014 05:43:28 GMT 
    Server: Apache/2.4.7 (Ubuntu) 
    Last-Modified: Tue, 26 Aug 2014 05:43:32 GMT 
    ETag: 1409031812.62 
    Content-Length: 2592 
    Keep-Alive: timeout=5, max=100 
    Connection: Keep-Alive 
    Content-Type: image/jpeg 

Google PageSpeed Insights for another page 내 HTML이 축소 된되지 말한다 동안 또한 Google PageSpeed Insights for my homepage에 따라 HTML은 축소 된입니다 .

왜 이렇게 다른 행동입니까?

+2

이 질문은 [webmaster.se] – hjpotter92

+1

@ hjpotter92에 적합하므로 다른 주제가 아닌 것처럼 보입니다. 다른 SE 사이트에 대한 주제가 다르기 때문에이 사이트에 대한 주제와 관련이 없다는 것을 의미하지는 않습니다. 그래서 특히 다른 SE 사이트와 꽤 겹치는 부분이 있습니다. OP가 여기에 답변을받지 못하면 영업 담당자가 웹 마스터에게 다시 질문하는 이유가 될 수 있습니다. 그러나 여기에서 답변을 닫아야하는 것은 아닙니다. – Sumurai8

+0

@ Sumurai8 VTC는 주제와 관련이 없으므로 사용자가 특정 분야에 관심을 갖고있는 다른 사이트로 마이그레이션하는 데 도움이됩니다. – hjpotter92

답변

0

Apache를 사용하여 미디어 파일을 재생하는 동안 Django를 사용하여 정적 파일을 제공하고있었습니다. 아파치를 통해 정적 파일을 검색하면이 문제가 해결됩니다.