Sam
Sam

Reputation: 15506

.php files are not compressing, while GZIP is set in .htaccess

According to checkgzipcompression all my .js and .css are correctly GZIP compressed.
Except for my php webpages:

www.website.nl/webpages.php seem not gzipped, resulting in a 75% increase in "wasted" data transfer. My .htaccess file ends with the following below. What needs to be changed here to get GZIP compression for my php webpages to work properly? (Excluding the .php files from the /includes/ folder ofcourse since those are not "transferred to the browser" and are processed internally so they need no compression). Thanks!

# compress speficic filetypes
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|txt|php)$">
    SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

enter image description here

Upvotes: 1

Views: 522

Answers (1)

user1763354
user1763354

Reputation:

Pages served in the browser with .php extension are considered html. PHP uses Content-Type "text/html" as default.

I would say, find out what's your web server, and then find out the correct compression method for it.

Good luck!

Upvotes: 1

Related Questions