Support forums : Quickies

pagespeed_mod-expires branch

A home for really quick one-liner thoughts about what we need to fix or do or whatever. If they spark discussion we move it, otherwise this is like post-it notes.

Moderator: Dracones

pagespeed_mod-expires branch

Postby EdB » Sun Jul 24, 2011 8:06 pm

Our forums are all messed up. Oh well.

So I'm gonna do another pagespeed branch. We'll probably end up with a fair amount of them as we get one thing then another then another fixed. This one, pagespeed_mod-expires", lives in our sample.htaccess file and is completely dependent on the installer's server configuration. For that reason it kinda shouldn't count as working towards a pagespeed score goal but too bad. The app will work fine if your host doesn't have mod_expires installed so there you go.

I figure this is also a good time to update some of the bits in our sample.htaccess file, and I'm only talking about the one in /root/ cuz I have no idea why we even have another one.

https://code.launchpad.net/~edb/quam-pl ... od-expires
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: pagespeed_mod-expires branch

Postby EdB » Mon Jul 25, 2011 2:03 am

Code: Select all
# Improve pagespeed score by leveraging browser caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/html A60
</IfModule>

The above bit is what I add to sample.htaccess because it works when I add it to my real .htaccess file. To explain:
Code: Select all
ExpiresByType "a file type" "A or M followed by number of seconds"

A is for access, M is for last modification of the file. A is better because each visitor has their own access moment, and the last modified date might not ever change. Default is 10 minutes, everything big is set to 30 days, text/html to 1 minute so if you edit a post the change will possibly/probably be seen by you as soon as you save the change ... instead of having to wait or do a CTRL+F5.

One very big drawback is that I can't seem to make it refresh the stupid styles for the stupid calendar that pops up when you want to edit a date on an item. It pops up outside the screen and with styles I can make that work nicer, but not without getting the damned css file to refresh, but a hard refresh of the page closes the popup so the browser doesn't seem to want to actually refresh that page. THEREFORE if we go with this type of solution we will also have to start versioning our style sheets and javascripts.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: pagespeed_mod-expires branch

Postby leeturner » Sun Aug 14, 2011 8:53 pm

Is this solution both front end and admin ?

L
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: pagespeed_mod-expires branch

Postby EdB » Sun Aug 14, 2011 9:57 pm

Front end only, but it has a bit of wrinkle-down to the admin side.

Minify is a better approach and could/should be made to work front and back. Unfortunately going down this path gets you really REALLY close to the god-awful nightmare of a twisted mess that is CSS in our app. Which of course lives right next door to the hellish mess of div-soup we wallow in. So I found a tiny little thing I could do on the front end that didn't kill anything and said "yay" to myself and branched it :)
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: pagespeed_mod-expires branch

Postby leeturner » Sun Aug 14, 2011 10:19 pm

Good call. Baby steps :-D
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: pagespeed_mod-expires branch

Postby EdB » Tue Feb 19, 2013 5:36 am

https://code.launchpad.net/~edb/quam-plures/qp5_monster and prior work addresses this issue in great detail ... though there is always more to do with this type of thing.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: pagespeed_mod-expires branch

Postby leeturner » Tue Feb 19, 2013 8:35 am

Does qp5 touch on minify or stays within the .htaccess work ?
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: pagespeed_mod-expires branch

Postby EdB » Tue Feb 19, 2013 5:52 pm

I couldn't really figure out how to implement various minify tools, especially given the amount of prework we'd need. we have functions that pull together scripts and styles, and some of those functions are the same. So making sense of it all didn't make sense to me.

Anyway "real minification" still needs to happen :(
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: pagespeed_mod-expires branch

Postby leeturner » Tue Feb 19, 2013 6:07 pm

Cool, just thought I would check :D
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: pagespeed_mod-expires branch

Postby Kimberly » Wed Feb 20, 2013 5:56 am

leeturner wrote:Does qp5 touch on minify or stays within the .htaccess work ?


The mention of .htaccess has me thinking of how the app will run under Nginx; which does not use .htaccess.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm

Next

Return to Quickies

Who is online

Users browsing this forum: No registered users and 1 guest

cron