News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[Depreciated]

Started by Depreciated, August 09, 2010, 08:39:48 PM

Previous topic - Next topic

Depreciated

Quote from: Sirius OCTeam on August 16, 2010, 06:17:08 AM
Hi

you should add those conditions to minimizing the internal server error crash risk for some users:
<IfModule mod_deflate.c>
#the code
</IfModule>
<IfModule mod_expires.c>
#the code
</IfModule>




This apart, IMUO we can achieve your htaccess settings in another way, mike this:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript text/x-js text/ecmascript application/ecmascript text/vbscript text/fluffscript
AddOutputFilterByType DEFLATE image/svg+xml application/x-font-ttf application/x-font font/opentype font/otf font/ttf application/x-font-truetype application/x-font-opentype application/vnd.ms-fontobject application/vnd.oasis.opendocument.formula-template
AddOutputFilterByType DEFLATE text/xml application/xml
</IfModule>
<IfModule mod_expires.c>
<FilesMatch "\.(ico|gif|jpg|JPG|jpeg|png|PNG|swf|css|js|html?|xml|txt)$">
ExpiresActive On
ExpiresDefault "access plus 10 years"
</FilesMatch>
</IfModule>


Just a question of taste and simplicity
replace "10 years" expiration time by what you need.

To tune for each file, simply look this post:
Quote from: nend on August 11, 2010, 12:57:22 PM
# 1 YEAR
<FilesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>
# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"
</FilesMatch>
# 1 MIN
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=60, private, proxy-revalidate"
</FilesMatch>


Anyway, good mod that many will use by far  ;)


excellent... i totally forgot about using <IfModule> so i've updated the mod

thanks for the support guys!

KensonPlays

Quote from: PaulpBaker on August 09, 2010, 09:00:22 PM
wow that's sucks i didn't know that but still a lot of people will get some use out of this mod as although simple it does give good results
I have Godaddy, I googled if they have those mod_deflate or mod_expires features, and I cannot find the answer anywhere, 5 pages of looking.

Owner of Mesozoic Haven

Depreciated

Quote from: Kcmartz on August 16, 2010, 07:24:30 PM
Quote from: PaulpBaker on August 09, 2010, 09:00:22 PM
wow that's sucks i didn't know that but still a lot of people will get some use out of this mod as although simple it does give good results
I have Godaddy, I googled if they have those mod_deflate or mod_expires features, and I cannot find the answer anywhere, 5 pages of looking.

you can install the mod and if you have any problems just delete the '.htaccess' in your web root

KensonPlays

Well the .htaccess contains Pretty URLs stuff. Don't want to delete that!

Owner of Mesozoic Haven

KensonPlays

It messed my site up. Cannot uninstall. I tried and keeps trying Pretty URLs stuff. but this mod overwrote Pretty URLs .htaccess contents. I cannot administer my site anymore. :(

Owner of Mesozoic Haven

Depreciated

Quote from: Kcmartz on August 16, 2010, 08:04:04 PM
It messed my site up. Cannot uninstall. I tried and keeps trying Pretty URLs stuff. but this mod overwrote Pretty URLs .htaccess contents. I cannot administer my site anymore. :(

1. i did say IF you have a '.htaccess' file you should manually install this

2. i also said if you do get any errors with this to just delete the '.htaccess' in your web root to uninstall this

KensonPlays

to delete my .htaccess is to ruin Pretty URLs.

Owner of Mesozoic Haven

Depreciated

Quote from: Kcmartz on August 16, 2010, 08:36:47 PM
to delete my .htaccess is to ruin Pretty URLs.

you installed this mod without reading the info/warnings about already having a .htaccess file as this mod overwrites it

simple delete you .htaccess as it is only from this mod and NOT Pretty URLs

Sirius OCTeam

#28
@PaulpBaker

your welcome

and if you want some more few YSlow points, you can add this too:
<FilesMatch "\.(ico|gif|jpg|JPG|jpeg|png|PNG|swf|css|js|html?|xml|txt)$">
Header unset ETag
FileETag none
</FilesMatch>


As the Etags become useless if we manage the expirations by the module.

I already use all of that since severals yaers on my smf, and got a :
YSlow Grade A Overall performance score 92
Page Speed Score: 81/100
;)

Depreciated

Quote from: Sirius OCTeam on August 16, 2010, 09:22:35 PM
@PaulpBaker

your welcome

and if you want some more few YSlow points, you can add this too:
<FilesMatch "\.(ico|gif|jpg|JPG|jpeg|png|PNG|swf|css|js|html?|xml|txt)$">
Header unset ETag
FileETag none
</FilesMatch>


As the Etags become useless if we manage the expirations by the module.

I already use all of that since severals yaers on my smf, and got a :
YSlow Grade A Overall performance score 92
Page Speed Score: 81/100
;)

once again thank you for your input but i didn't notice any changes with the yslow score when adding that code to the <IfModule mod_expires.c> tag?

Depreciated

Quotev2.0 - 17th August 2010: Total rewrite of the mod so stop it from causing problems for people who already have a .htaccess file

Sirius OCTeam

Quote from: PaulpBaker on August 16, 2010, 09:33:27 PM
Quote from: Sirius OCTeam on August 16, 2010, 09:22:35 PM
@PaulpBaker

your welcome

and if you want some more few YSlow points, you can add this too:
<FilesMatch "\.(ico|gif|jpg|JPG|jpeg|png|PNG|swf|css|js|html?|xml|txt)$">
Header unset ETag
FileETag none
</FilesMatch>


As the Etags become useless if we manage the expirations by the module.

I already use all of that since severals yaers on my smf, and got a :
YSlow Grade A Overall performance score 92
Page Speed Score: 81/100
;)

once again thank you for your input but i didn't notice any changes with the yslow score when adding that code to the <IfModule mod_expires.c> tag?

It's independent, you must not put that into the  <IfModule mod_expires.c>

If you want you can put that, as this into the htaccess
Header unset ETag
FileETag none


And so if it's ok then, you must have the "Grade A on Configure entity tags (ETags)" under YSlow.

Sometimes (like on CPanel WHM) you can directly set the ETags  to off on the server, in this case you already got the Grade A for ETags, so you don't need this code in the htaccess.


R.Bourne


MultiformeIngegno

Thank you!
Maybe a stupid question: does this work also if I've enabled smf caching (level 2)?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Depreciated

Quote from: MultiformeIngegno on August 18, 2010, 09:58:37 AM
Thank you!
Maybe a stupid question: does this work also if I've enabled smf caching (level 2)?
sure will

MultiformeIngegno

I already have a .htaccess file.. if I add this to it does it work as I have the mod installed?

<IfModule mod_deflate.c>
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript text/x-js text/ecmascript application/ecmascript text/vbscript text/fluffscript
   AddOutputFilterByType DEFLATE image/svg+xml application/x-font-ttf application/x-font font/opentype font/otf font/ttf application/x-font-truetype application/x-font-opentype application/vnd.ms-fontobject application/vnd.oasis.opendocument.formula-template
   AddOutputFilterByType DEFLATE text/xml application/xml
</IfModule>
<IfModule mod_expires.c>
<FilesMatch \"\.(ico|gif|jpg|JPG|jpeg|png|PNG|swf|css|js|html?|xml|txt)$\">
ExpiresActive On
ExpiresDefault \"access plus 1 month\"
</FilesMatch>
</IfModule>
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Depreciated

Quote from: MultiformeIngegno on August 19, 2010, 09:37:09 AM
I already have a .htaccess file.. if I add this to it does it work as I have the mod installed?

this mod won't overwrite your .htaccess file it'll only add to it so it's safe to install

MultiformeIngegno

Okay! :)
But will it work if I add that code without installing the mod?
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Depreciated

Quote from: MultiformeIngegno on August 19, 2010, 09:48:10 AM
Okay! :)
But will it work if I add that code without installing the mod?
sure will

MultiformeIngegno

So it's usable on all servers with mod_deflate/expires enabled, also if smf is not installed? :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Advertisement: