Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [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
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
tomi1985
post
Post #3





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

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


caly kod i nie dziala (IMG:style_emoticons/default/sad.gif) serwer mam na 1and1.pl

  1. AddType x-mapp-php5 .php
  2. AddHandler x-mapp-php5 .php
  3.  
  4. <IfModule mod_deflate.c>
  5.  
  6. # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  7. <IfModule mod_setenvif.c>
  8. <IfModule mod_headers.c>
  9. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  10. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  11. </IfModule>
  12. </IfModule>
  13.  
  14. # Compress all output labeled with one of the following MIME-types
  15. <IfModule mod_filter.c>
  16. AddOutputFilterByType DEFLATE application/atom+xml \
  17. application/javascript \
  18. application/json \
  19. application/rss+xml \
  20. application/vnd.ms-fontobject \
  21. application/x-font-ttf \
  22. application/xhtml+xml \
  23. application/xml \
  24. font/opentype \
  25. image/svg+xml \
  26. image/x-icon \
  27. text/css \
  28. text/html \
  29. text/plain \
  30. text/x-component \
  31. text/xml
  32. </IfModule>
  33.  
  34. </IfModule>
  35.  
  36. RewriteEngine On
  37. # włączenie przepisywania linków
  38. RewriteBase /
  39.  
  40. RewriteRule regulamin/ regulamin.php
  41. RewriteRule cennik/ cennik.php
  42. RewriteRule kontakt/ kontakt.php
  43. RewriteRule search/ search.php
  44. RewriteRule polityka-prv/ polityka.php
  45. RewriteRule mapa/ mapa_serwis.php
  46. RewriteRule panel/ panel.php
  47. RewriteRule wspolpraca/ wspolpraca.php
  48.  
  49. #rejestracja
  50. RewriteRule ^regi,([^-]*).html$ /regi.php?i=$1 [L]
  51.  
  52.  
  53. RewriteRule ^search,([^-]*).html$ /search.php?reg=$1 [L]
  54.  
  55. RewriteRule ^/?([^/]*)/([^/]*)/$ search.php?view=$1&i=$2 [NC,L]
  56.  
  57.  
  58. #porcjowanie wyników dla kat, woj, reg
  59.  
  60. RewriteRule ^/?([^/]*)/([^/]*)/([^/]*)/([^/]*)/$ search.php?view=$1&i=$2&q=$3&f=$4 [NC,L]
  61.  
  62.  
  63. #porcjowanie wyników dla wyszukiwarki
  64.  
  65. RewriteRule ^/?([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/$ search.php?view=$1&kategoria=$2&wojewodztwo=$3&miejscowosc=$4&q=$5&f=$6 [NC,L]
  66.  
  67.  
  68.  
  69. #show id
  70. RewriteRule ^/?([^/]*)/([^/]*).html$ show.php?id=$1&firm=$2 [L]
  71.  
  72.  
  73.  
  74. #admin log out, save
  75. RewriteRule ^admin,([^-]*).html$ /admin.php?view=$1 [L]
  76.  
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #4





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

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


Witam.

No to nie masz mod_deflate ...

Wytnij wszystko i daj na próbę.

[APACHE] pobierz, plaintext
  1. <IfModule mod_headers.c>
  2. <IfModule mod_deflate.c>
  3. Header set X-Content-Type-Options "nosniff"
  4. </IfModule>
  5. </IfModule>
[APACHE] pobierz, plaintext


Jak nie zobaczysz tego nagłówka to nie masz mod_deflate (IMG:style_emoticons/default/smile.gif)

Ten post edytował rocktech.pl 12.11.2012, 19:22:30
Go to the top of the page
+Quote Post
tomi1985
post
Post #5





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

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


Wyciałem wszystko w pliku i wstawilem tylko to co kolega wyzej napisal

Date: Mon, 12 Nov 2012 18:26:13 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Content-Length: 41273
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Content-Type: text/html

200 OK

taki wynik w dodatku do ff web developer....

a pamiec podreczna zadziala ? dla fotek i plikow ?

Ten post edytował tomi1985 12.11.2012, 19:28:03
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #6





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

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


Sprawdź konfigurację na serwerze i zobacz dostępne moduły.
Go to the top of the page
+Quote Post
tomi1985
post
Post #7





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

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


sprawdzilem w php ini i mam tak :
  1. HTTP_ACCEPT_ENCODING gzip, deflate

cos jeszcze znalezc ?

  1. Additional Modules
  2.  
  3. Module Name
  4.  
  5. dbase


Może trzeba coś dodać w pliku php... w tym wypadku ( u mnie ) naglowek.php... (IMG:style_emoticons/default/questionmark.gif) ? przepraszam za moją niewiedzę ale robie to pierwszy raz... a kto pyta nie bładzi

napisalem tez email do admina 1and1... czy mam wszystkie opcje włączone w celu poprawnego wykonania tych skryptów

właśnie dostałem wiadomość od admina serwera, że serwer nie obsługuje mod_gzip i mod_deflate ;/
a jak wygląda z pamięcią podręczną ? skoro tego nie obsluguje to i pamięci również.... ?
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #8





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

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


Istnieje jeszcze mod_expires.

Oraz nagłówki ...

Kod
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Go to the top of the page
+Quote Post
tomi1985
post
Post #9





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

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


jaki serwer polecacie z wyżej wymienionymi funkcjami....

PageSpeed Insights mam tylko 29/100 a chcialbym miec chociaz z 80/100
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #10





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

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


Polecam ci kimsufi i serwery dedykowane.
Go to the top of the page
+Quote Post
tomi1985
post
Post #11





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

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


przepraszam, źle sprecyzowałem pytanie... chodziło mi o hosting... na serwer obecnie nie mam warunków w domu ;/

co sądzicie o tym pakiecie:

http://linuxpl.com/Konto-W2GB_f_2_pakiet_20
Go to the top of the page
+Quote Post
toffiak
post
Post #12





Grupa: Zarejestrowani
Postów: 395
Pomógł: 80
Dołączył: 24.08.2009

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


Jeżeli tak bardzo zależy ci na ilości punktów w PageSpeed to mogę powiedzieć że na podanym hostingu można osiągnąć > 90 pkt, w stosunkowo rozbudowanym serwisie. Choć i tak większość pracy jest po twojej stronie i hosting nie ma tu znaczenia.
Go to the top of the page
+Quote Post
tomi1985
post
Post #13





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

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


tak to prawda aczkolwiek 80 % zmniejszonej predkosci w pagespeed jest spowodowane tym ze nie mam kompresji i pamieci podrecznej... ;/
Go to the top of the page
+Quote Post

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: 20.12.2025 - 18:29