Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] kompresja Gzip dla plików żródłowych.
pieto
post
Post #1





Grupa: Zarejestrowani
Postów: 227
Pomógł: 1
Dołączył: 12.05.2002
Skąd: gdańsk

Ostrzeżenie: (0%)
-----


Witam, kolejnym moim problem jest niemożność skopresowania pliku źórdłowych.

Mam sklep osc, kompresuje go przez stadardowo funcje tego sklepu (ob_start, ob_flush), ale kompresuje tylko plik głowny - oczywiscie nie bierze resourcow np js css,
jakis sposob aby skompresowac calosć ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
heaven
post
Post #2





Grupa: Nieautoryzowani
Postów: 92
Pomógł: 15
Dołączył: 21.10.2006

Ostrzeżenie: (0%)
-----


Hejka
znalazlem cos takiego

It is also possible to use ob_gzhandler to compress css and javascript files, however some browsers such as firefox expect content type text/css on css files.

To get around this send a content type header:
  1. <?php
  2. ob_start('ob_gzhandler');
  3. ?>
  4.  
  5. .... your css content ...
  6.  
  7. <?php
  8. header("Content-Type: text/css");
  9. header('Content-Length: '.ob_get_length());
  10. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 20:12