Closed Bug 424187 Opened 18 years ago Closed 18 years ago

Increase ySlow score for all AMO pages to A

Categories

(addons.mozilla.org Graveyard :: Public Pages, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rdoherty, Assigned: brian)

References

()

Details

(Keywords: perf)

Attachments

(5 files)

Just did a quick ySlow run for the AMO homepage, F! Here's a rundown of the score. It won't be easy to fix everything, but it's possible :) Performance Grade: F (57) F 1. Make fewer HTTP requests This page has 4 external JavaScript files. This page has 5 external StyleSheets. This page has 19 CSS background images. F 2. Use a CDN F 3. Add an Expires header These components do not have a far future Expires header: (all files) F 4. Gzip components These components are not gzipped: https://preview.addons.mozilla.org/js/__utm.js https://preview.addons.mozilla.org/en-US/firefox/pages/js_constants.js https://preview.addons.mozilla.org/js/jquery-compressed.js https://preview.addons.mozilla.org/js/addons.js A 5. Put CSS at the top C 6. Put JS at the bottom 4 external scripts were found in the document HEAD. Could they be moved lower in the page? A 7. Avoid CSS expressions n/a 8. Make JS and CSS external A 9. Reduce DNS lookups B 10. Minify JS https://preview.addons.mozilla.org/js/__utm.js https://preview.addons.mozilla.org/js/addons.js A 11. Avoid redirects A 12. Remove duplicate scripts A 13. Configure ETags
Assignee: nobody → rdoherty
Blocks: 404344
For the JS files, we already use a compressed version of jquery, we could do the same for the others, while keeping the uncompressed ones around for development of course ;). We'd need to remember re-compressing them for every change to the source files though.
(In reply to comment #1) We use a packed version of jquery, which is actually bigger than a gzipped version of the minified one. See bug 422815. We'll need a build script to create a release version of AMO that can conctatenate all CSS & JS, minify and change src urls in templates. See http://developer.yahoo.com/performance/rules.html & http://developer.yahoo.net/blog/archives/2008/03/yahoos_latest_p.html
Depends on: 422815
http://stevesouders.com/cuzillion/ Neat tool to test various page performance issues.
Depends on: 439702
Taking this, will begin work on it next week.
Assignee: rdoherty → bkrausz
FYI we are up to a C for the homepage. Gzipping and adding addons.mozilla.org as a CDN are the reasons. addons.mozilla.org can be considered a semi-cdn because we have 3 locations for our datacenters around the world.
OS: Mac OS X → All
Hardware: PC → All
Version: 3.2 → unspecified
My dev environment has 1 and 10 brought up to an A (will be checking in after code review today). That makes the only things not A's: 3. Add an Expires header (F) 6. Put JS at the bottom (C) I will investigate if 6 can be done. For 3 we can set future expires headers for our images, as long as we remember to change file names if we change files. I already have a build script written to compress/minify JS & CSS, we can set future expires for these in conjunction with a build-set timestamp or revision #. Example: We push a new stylesheet, r12345. Url to stylesheet is styles.min.css?12345 Next push, r23456 url is updated to styles.min.css?23456 The one issue is how/where to store this parameter. Ideally this can be done as part of the build process Ryan's working on, where it dumps the revision to a file ala `define('REVISION', 12345);` Opinions?
(In reply to comment #6) > My dev environment has 1 and 10 brought up to an A (will be checking in after > code review today). Sweet :) > The one issue is how/where to store this parameter. Ideally this can be done > as part of the build process Ryan's working on, where it dumps the revision to > a file ala `define('REVISION', 12345);` > > Opinions? > It can definitely be done via a build process. For now it could be something really simple that does the performance stuff, then checks with svn for the rev # and writes out/appends to a file with the revision #. As much as I want a more structured/complicated build tool, simple scripts may be enough for now :)
Everything's been committed: r16721. Will look into having it stages/QAed. A change needs to be deployed to staging/production config files to enable js/css compression, will file IT bug.
http://viewvc.svn.mozilla.org/vc/addons/branches/performance/site/app/config/constants.php?limit_changes=0&r1=16721&r2=16720&pathrev=16721 SITE_URL is already defined and isn't in that format -- I'm guessing you meant to have SITE_STATE. Kinda nervous about all these global changes without review.
Correct, SITE_STATE (I don't recall specifying a file). rdoherty and I had an offline review since there was an image and a lot of minor things involved. I'll attach a patch here for review and approval.
(In reply to comment #9) > > Kinda nervous about all these global changes without review. > I reviewed them with Brian earlier today.
Doh, just realized my checkin has all the info of the patch, nevermind :-P
I think you misunderstood my SITE_URL comment. SITE_URL is now defined twice in constants.php. /** * Site URL default */ if (!defined('SITE_URL')) define('SITE_URL', 'http://addons.mozilla.org'); /** * Site State default */ if (!defined('SITE_URL')) define('SITE_URL', 'dev');
aha, my mistake. All fixed: r16723.
Marking this complete...needs QA. Here's the process for getting this up (just FYI): 1) QA, make sure I didn't screw anything up ;-) 2) Push to production. This will enable my spriting, but the file concatenation requires a config change. 3) Once that's up, I'll file a bug for adding the config parameter to enable file concatenation to production and staging. QA: please look over anything involving background graphics, layout, and javascript (primarily the bg graphics, that has the most change). Thanks!
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
4) Ask IT to up cache time for js/css to years.
1.1) Prioritize with next AMO release 1.2) Merge branch into trunk
Target Milestone: --- → 3.4.6
Blocks: 444388
Blocks: 444392
Blocks: 444393
Stephen should be looking at this today...forgot to remind him: in addition to checking background images and basic JS in english, can you check it in an rtl language such as he? Thx!
Reopening; IE 6 isn't really as happy as it could be with this :-(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
http://bk-amo.khan.mozilla.org isn't functional right now for me to resume testing (I can reach the host, just am returned a blank page) -- Brian, can you take a look?
Strange, I haven't touched it since Saturday, and it was working then. Could be a db issue, will investigate tomorrow.
Nevermind...mysql had crashed...restarted it. Working fine now :)
This is fine on production and preview, but in your perf instance, the "Advanced" tab for longer-length texts (such as in the [nl] locale) don't get their background completely filled.
Also, the add-ons featured in the "Recommended" pages (http://bk-amo.khan.mozilla.org/en-US/firefox/recommended) are missing their background fill too. Ditto for http://bk-amo.khan.mozilla.org/en-US/firefox/browse/type:1/cat:all?show=20&exp=on&sort=newest, which also suffers from its bottom border image not being aligned right.
Take a look at the "Chrome List" add-on's bottom-border image (mis)alignment.
Everything should be all prettied up now :-D
The issues in comment 6 / comment 7 are fixed. In addition to Firefox 2 / 3, I tested: * Safari 3.1.2 * Opera 9.51 * IE 7 * IE 6 [1] Caveats: [1] IE 6 is still affected as it was in comment 21 / comment 22, but basic functionality still seems to be there; heard we're not holding up this for IE 6, since it still works, just doesn't look pretty. [2] I didn't get a chance to test the theme browser view (https://addons.mozilla.org/en-US/firefox/browse/type:2/cat:all?sort=name), because the bk-amo.khan.mozilla.org instance has a weird DB dump/old code. Anyway, with those couple issues noted, I think it looks good; nice work, Brian!
Argh, I meant "the issues in comment 26 / comment 27 are fixed." -- sorry!
Boss-man...can you confirm that this screenshot of IE6 is ok, assuming functionality is still intact? https://bugzilla.mozilla.org/attachment.cgi?id=329552 If that is OK I'll merge perf branch into trunk. Thanks!
I'm okay with it.
morgamic++ r17141, done
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Forgot the tag
Keywords: push-needed
As our YSlow score has moved up but to only a "D" (1. went from F->D, and 2. dropped from B->C), I'm assuming we still need the config change on preview; oremj: can we get that implemented so I can re-run YSlow and verify before we push to prod? Thanks!
Comments on parts of current score: > D 1. Make fewer HTTP requests > This page has 4 external JavaScript files. > This page has 5 external StyleSheets. > This page has 11 CSS background images. These will be combined into 3 JS files and 1 stylesheet once config changes get pushed (bug 445869). The images are a result of the new middle box not using my CSS. I filed bug 445972 for this, I'll fix it tomorrow. > F 2. Use a CDN If you expand this tab you see an option for adding to the CDN list. You can add m.o and m.c, since we have multiple clusters in different geographic regions, qualifying us as a mini-CDN. > F 3. Add an Expires header Once we get this stuff pushed I can file to add expires headers to *.js? and *.css?, but until then I can't Everything else is an A, and the above changes will most likely bring these into A's. A's for everyone!
(In reply to comment #36) > > F 3. Add an Expires header > > Once we get this stuff pushed I can file to add expires headers to *.js? and > *.css?, but until then I can't We'll probably want to double-check we're not missing any css or js files. If we do we could accidentally send users files that never expire (until we change the url).
I was actually hoping they could do URL matching for .css? and .js?, that way CSS and JS files that we miss won't be cached. Either way I'll look around for css/js that we missed.
(In reply to comment #38) > I was actually hoping they could do URL matching for .css? and .js?, that way > CSS and JS files that we miss won't be cached. Either way I'll look around for > css/js that we missed. > Ah, good point.
So, we're good to go, looks like. As mentioned in comment 36, we can't do F until we push to production, and the only other remaining score is 6. Put JS at the bottom, which I'm guessing we can't do for various reasons. I'll verify this bug after we push to production.
Do we need a separate bug (IT bug?) for the expires headers stuff? (Comment 36.)
Yes we do, see bug 448050
(In reply to comment #43) > Yes we do, see bug 448050 Someone please cc me on that?
Depends on: 449123
Keywords: push-needed
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: