0

I'm using mod_deflate to compress my web pages but I see that only the HTML is compressed no compression for the css.

Documents (1 file) 4 KB (18 KB uncompressed)
    http://localhost/web/ 4 KB (18 KB uncompressed)
Images (16 files) 96 KB
Objects (0 files) 
Scripts (2 files) 26 KB (73 KB uncompressed)
    http://code.jquery.com/jquery-1.4.2.min.js 24 KB (70 KB uncompressed)
    http://localhost/web/js.js 2 KB
 Style Sheets (1 file) 6 KB
    http://localhost/web/css/style.css 6 KB
 Total 132 KB (192 KB uncompressed)

My .htaccess looks like:

<ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

Any suggestions? Thanks in advance.

Gumbo
  • 643,351
  • 109
  • 780
  • 844
medk
  • 9,233
  • 18
  • 57
  • 79
  • Should this maybe be a serverfault question? – Pointy Oct 09 '10 at 16:54
  • *How* do you use mod_deflate to compress your HTML documents? – Gumbo Oct 09 '10 at 16:55
  • # BEGIN GZIP AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript # END GZIP – medk Oct 09 '10 at 16:56
  • @mohamed87: Where does it say that your HTML document is compressed? – Gumbo Oct 09 '10 at 17:02
  • using Web Developer -> information -> view document size – medk Oct 09 '10 at 17:06
  • @mohamed87: Ah, my mistake. Now I see that every “uncompressed” means it actually is compressed. – Gumbo Oct 09 '10 at 17:09
  • @mohamed87: But what is your *http://localhost/web/*? Is it a static HTML file? – Gumbo Oct 09 '10 at 17:09
  • no it's dynamic and this is the root of one of the websites that I locally develop. for this it's a php page index.php which includes another dynamic file like home.php or category.php?cat=foo&pg=bar But here it's ok with the main document as it is compressed. the problem concerns the css and js excluding the jQuery as it comes compressed from it's CDN – medk Oct 09 '10 at 17:14
  • @mohamed87: Maybe PHP is already compressing the data (see for example [`ob_gzhandler`](http://php.net/ob_gzhandler)). – Gumbo Oct 09 '10 at 17:55

1 Answers1

0

Ok I don't know how, this finally worked and the css became 2KB instead of 6KB. Thanks everybody for your help.

medk
  • 9,233
  • 18
  • 57
  • 79