Apache mod_deflate não está compactando arquivos javascript e css?

4
"GET /Symfony/web/app.php/app/dashboard HTTP/1.1" 4513/37979 (11%)
"GET /Symfony/web/css/application.css HTTP/1.1" -/- (-%)
"GET /Symfony/web/js/application.js HTTP/1.1" -/- (-%)
"GET /Symfony/web/js/highcharts.js HTTP/1.1" -/- (-%)
"GET /Symfony/app/Resources/public/img/logo.png HTTP/1.1" -/- (-%)

Não sei se há algo errado com minha configuração, mas o sem compactação para css e js parece estranho para mim.

No entanto, ambos css e js já foram reduzidos. Aqui está a seção relevante do Apache em cong / httpd.conf:

# Deflate
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

DeflateCompressionLevel 9

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# IE5.x and IE6 get no gzip, but allow 7+
BrowserMatch \bMSIE\s7 !no-gzip

Header append Vary User-Agent env=!dont-vary

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate.log deflate
    
por user34295 18.07.2012 / 03:38

1 resposta

0

defina seu .htaccess também. Este é apenas um exemplo:

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary

#Dealing with proxy servers
<IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>

</IfModule> 
    
por 18.07.2012 / 06:16