Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne][PHP].htaccess - konfiguracja kompresji
tomi1985
post
Post #1





Grupa: Zarejestrowani
Postów: 192
Pomógł: 12
Dołączył: 23.09.2010
Skąd: Warszawa

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


Witam Serdecznie

Mam dość duży problem z próbą kompresji plików gzip na mojej stronce... a mianowicie nie działa mi (IMG:style_emoticons/default/sad.gif)

o to mój kod

  1.  
  2. <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
  3. <IfModule mod_expires.c>
  4. ExpiresActive on
  5. ExpiresDefault A2592000
  6. Header append Cache-Control "public"
  7. </IfModule>
  8. Header unset ETag
  9. FileETag None
  10. </FilesMatch>
  11.  


sprawdzalem w
PageSpeed Insights i nic.. wogóle mi to nie działa...


dodam tylko, że robie to pierwszy także moja wiedza z tego za kresu nie jest powalająca

Czy mam coś wstawić również w nagłówku strony w php ? sam już nie wiem co muszę zrobić...

Ten post edytował tomi1985 11.11.2012, 16:37:22
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
rocktech.pl
post
Post #2





Grupa: Zarejestrowani
Postów: 587
Pomógł: 131
Dołączył: 8.02.2010

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


Witam.

Żywcem z https://github.com/h5bp/html5-boilerplate/b.../.htaccess#L153

[APACHE] pobierz, plaintext
  1. <IfModule mod_deflate.c>
  2.  
  3. # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  4. <IfModule mod_setenvif.c>
  5. <IfModule mod_headers.c>
  6. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  7. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  8. </IfModule>
  9. </IfModule>
  10.  
  11. # Compress all output labeled with one of the following MIME-types
  12. <IfModule mod_filter.c>
  13. AddOutputFilterByType DEFLATE application/atom+xml \
  14. application/javascript \
  15. application/json \
  16. application/rss+xml \
  17. application/vnd.ms-fontobject \
  18. application/x-font-ttf \
  19. application/xhtml+xml \
  20. application/xml \
  21. font/opentype \
  22. image/svg+xml \
  23. image/x-icon \
  24. text/css \
  25. text/html \
  26. text/plain \
  27. text/x-component \
  28. text/xml
  29. </IfModule>
  30.  
  31. </IfModule>
[APACHE] pobierz, plaintext
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: 28.12.2025 - 20:23