i have a linode sever with centos 6 , as it wont support mod_gzip, i am using mod_deflate.
this is my code in .htacess
<IfModule mod_deflate.c>
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
when i tested using http://www.whatsmyip.org/http-compression-test/ , its saying 'my site is gzipped' , but when i used pagespeed in chrome, it still suggest 'Enable compression'
whats wrong? any problem with my .htaccess code?
I used deflate mode in this way:
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
</IfModule>
And it's working perfectly for me. Pagespeed for my site is:
Desktop: 91
Mobile: 83
References which I have used for my site:
http://www.quickregisterseo.com/improve-google-page-speed-score-wordpress-without-plugins/
https://dzone.com/articles/steps-improve-your-pagespeed-insight-score
I've had this same problem. It seems pagespeed in Chrome sometimes gives the wrong results. I recommend using http://webpagetest.org or http://gtmetrix.com if you really want to be sure. You should always test these sorts of things on different websites, don't just rely on one or two tests. Some websites or tools give the wrong results.
Related
We are planning to move from X86 environment environment to arm based environment and in the process we wanted to test Graviton instance - c7g
I am trying to implement gzip compression in Apache using the following steps.
SetOutputFilter DEFLATE
SetEnv force-gzip true
DeflateCompressionLevel 9
DeflateMemLevel 9
DeflateWindowSize 1
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
Also made sure the modules mod_filter and mod_deflate is enabled. Per Amazon documentation, https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.migration-al.html
Does this means we can't use gzip compression even at Apache level
Kindly confirm
Gzip is not working properly. I have added the below code in .htaccess to enable gzip. but it doesnot make any change in Compressing my website:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
AddType text/css .css
In checkgzipcompression.com, it says Gzip is enabled. Any ideas in solving this issue?
I'm using deflate in a .htaccess-file. But this does not work in WampServer:
# deflate depending on filetype
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-shockwave-flash
</IfModule>
What am I doing wrong?
I was working on microsoft environment, but now I moved my website to ubuntu, the problem is, when I try to write a link like this, 127.0.0.1/asd, I get not found error, the thing that makes me crazy is, that URL sometimes work sometimes does not work and It was working great on windows environment, this is the error I get,
Not Found The requested URL /asd was not found on this server.
this is my .htaccess,
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>
RewriteEngine On
RewriteRule ^([//a-zA-Z0-9_-]+)$ tab.php?tab_id=$1 [QSA,L]
Your problem seems to be your rewrite rule - "//" should be "\/" - what does your apache conf file look like, does it have .htaccess enabled for that directory?
I'm trying to make Gzip compression work on xampp, right now this is in my .htaccess
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
The HTML file gets compressed, but nothing happens to the JavaScript and CSS files. Anyone know why? How to fix this? (if it's even possible)
Okay... stupid fault... browser still used cached versions...