Jump to content

.htaccess Compression and CSS files?


random1

Recommended Posts

Hey All,

 

I have the below code in my .htaccess file:

 

<IfModule mod_gzip.c>
mod_gzip_on yes
mod_gzip_dechunk yes
mod_gzip_keep_workfiles No
mod_gzip_temp_dir /tmp
mod_gzip_minimum_file_size 1002
mod_gzip_maximum_file_size 1000000
mod_gzip_maximum_inmem_size 1000000
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.css$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
</IfModule>

 

This code is correctly gzip compressing files when the browser cache is empty but it is not compressing a CSS file upon refresh (F5).

 

Upon refresh my site checker says:

 

Grade B on Compress components with gzip

 

There is 1 plain text component that should be sent compressed

 

    * _______WEBSITE URL IS HERE________/stylesheet.css

 

It is only upon refresh.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/165304-htaccess-compression-and-css-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.