Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Jak włączyć komresję?
luniek88
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 19.09.2010

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


Witam,

podczas sprawdzania strony przez PageSpeed Insights wyskoczyło mi takie coś:
Włącz kompresję
Kompresja zasobów przy użyciu algorytmu gzip lub deflate może zmniejszyć liczbę bajtów przesyłanych przez sieć.

Szukam już kilka dni rozwiązania, ale bezskutecznie. Proszę Was o pomoc smile.gif


--------------------
Fireshow
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
flashdev
post
Post #2





Grupa: Zarejestrowani
Postów: 812
Pomógł: 117
Dołączył: 2.12.2008

Ostrzeżenie: (10%)
X----


JavaScript? No może jeśli serwer jest postawiony na nodzie.

Poszukaj w ustawieniach serwera np. w apachu /etc/apache


--------------------
Go to the top of the page
+Quote Post
pedro84
post
Post #3





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Słabo szukasz wink.gif

W szczególności:
http://stackoverflow.com/questions/1236785...ression-to-work
http://www.feedthebot.com/pagespeed/enable-compression.html
http://serverfault.com/questions/505305/ap...zip-compression

Cytat(flashdev @ 21.10.2013, 19:55:28 ) *
Poszukaj w ustawieniach serwera np. w apachu /etc/apache

Jak już coś to /etc/apache2 lub /etc/httpd (dla CentOS i pokrewnych) wink.gif


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
luniek88
post
Post #4





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 19.09.2010

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


Oczywiście widziałem linki podsyłane wyżej i już piszę co się dzieje. Na większość tych kodów moja strona nie reagowała. Dopiero zadziałało:
####################
# GZIP COMPRESSION #
####################
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary

Po wrzuceniu tego kodu w .htaccess na Page Speed Insights pokazało mi, że moja strona ma 98% szybkości otwierania się. Niestety moja strona wyrzucała błąd:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@teatrmantra.pl and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Co robić?

Ten post edytował luniek88 21.10.2013, 19:38:22


--------------------
Fireshow
Go to the top of the page
+Quote Post
pedro84
post
Post #5





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


A mod mod_deflate jest włączony w konfiguracji Apache'a? Co logi mówią?


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
luniek88
post
Post #6





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 19.09.2010

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


A co to jest ta konfiguracja Apache? Gdzie jej szukać? Proszę o pomoc smile.gif


--------------------
Fireshow
Go to the top of the page
+Quote Post
pedro84
post
Post #7





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Patrz mój wcześniejszy post w tym temacie.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 16:42