Posts: 339
Threads: 44
Joined: Jan 2011
Rob Wrote:It's text/javascript instead of application/x-javascript. That is probably why js isn't getting cached.
Good job. Pages seem to be pretty instant for me now.
Fun information regarding how ****ed up HTML is:
http://stackoverflow.com/questions/18985...f-a-script
Posts: 2,059
Threads: 158
Joined: Jan 2011
Yeah, I think I saw that in my endless search through Google for an answer. I ended up trying to do it with the
tag in the .htaccess instead and it's still ignored. Check it:
Quote:#Gzip
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
SetOutputFilter DEFLATE
#End Gzip
Going to try asking the peer-support forums. It could be that the method won't work in conjunction with mod_deflate.
Also, I think I'll play with some CSS sprites to see what I can do to lower the number of requests. I really like optimizing stuff. Just ask Taran about my static-management obsession.
Posts: 2,059
Threads: 158
Joined: Jan 2011
Hurray for jerry-rigging things. I ended up just compressing all the .js and .css files into their own .gz file, then adding handlers for the resulting files, along with a rewrite to use the pre-zipped ones instead. It should also lower the load on the server and be even faster than having it deflate the file every time. ;3
One liner to gzip all css and js files Wrote:find . -regex ".*\(css\|js\)$" -exec bash -c 'echo Compressing "{}" && gzip -cf --best "{}" > "{}.gz"' \;
.htaccess addition Wrote:
AddType "text/javascript" .gz
AddEncoding gzip .gz
AddType "text/css" .gz
AddEncoding gzip .gz
RewriteEngine on
#Check to see if browser can accept gzip files.
ReWriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
#make sure there's no trailing .gz on the url
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
#check to see if a .gz version of the file exists.
RewriteCond %{REQUEST_FILENAME}.gz -f
#All conditions met so add .gz to URL filename (invisibly)
RewriteRule ^(.+) $1.gz [QSA,L]
Posts: 126
Threads: 8
Joined: May 2011
Forums have been real slow for me the last day or two.
Posts: 2,059
Threads: 158
Joined: Jan 2011
Hmm, what browser you on? Also, what's your ping to in-uo.net look like?
Pages are loading in .8 seconds for me after I've loaded the pages the first time.
http://gtmetrix.com/reports/in-uo.net/3w0AarjG
I'm not seeing much else to change. Maybe I could use CSS Sprites for the forum images and work on optimizing image size for the ones that exist. But, with the expires headers and caching, that shouldn't really be affecting it very much.
Posts: 126
Threads: 8
Joined: May 2011
Eru Wrote:Hmm, what browser you on? Also, what's your ping to in-uo.net look like?
Pages are loading in .8 seconds for me after I've loaded the pages the first time.
http://gtmetrix.com/reports/in-uo.net/3w0AarjG
I'm not seeing much else to change. Maybe I could use CSS Sprites for the forum images and work on optimizing image size for the ones that exist. But, with the expires headers and caching, that shouldn't really be affecting it very much.
Weird... it seems find today. *shrug*
Posts: 2,059
Threads: 158
Joined: Jan 2011
I did a few more tricks to speed it up. Mostly I'm optimizing image sizes to make sure that they're compressed as much as possible.
Also, I got rid of all the external images like the vote buttons and moved them to load from our server instead.
Probably wont' make much difference, but it's kinda fun if you're a masochist.