Code Monkey home page Code Monkey logo

yslow's Introduction

YSlow

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.

Building

All flavors:

make

Specific flavor:

make <flavor>

Available flavors:

e.g.:

make chrome

Packaging

All flavors:

make pkg

Specific flavor:

make pkg-<flavor>

e.g:

make pkg-firefox

More Info

yslow.org

Licensing

Copyright (c) 2012, Yahoo! Inc. All rights reserved.
Copyright (c) 2013, Marcel Duran and other contributors. All rights reserved.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.

Bitdeli Badge

yslow's People

Contributors

bitdeli-chef avatar brewt avatar derek avatar janodvarko avatar marcelduran avatar naltatis avatar nanocaiordo avatar papandreou avatar rgrove avatar seabre avatar soulgalore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yslow's Issues

Keep bookmarklet preferences persistent across sessions/pages

Have an invisible iframe pointing to yslow.org/preferences.html then use localStorage on this page and communicate back to YSlow bookmarklet through postMessage.

+------------------------------+
|                              |
|      Host page: foo.com      |
|                              |
|------------------------------|
|                              |
|  YSlow bookmarklet           |
|    * postMessage <--------+  |
|                           |  |
|  +---------------------+  |  |
|  | yslow.org/pref.html |  |  |
|  | * localStorage      |  |  |
|  | * postMessage <--------+  |
|  +---------------------+     |
|                              |
+------------------------------+

HTTP header names aren't interpreted case insensitively

I first ran into this issue while using YSlow to optimize a web app written in node.js, where there's a convention of using all lower case header names. I wasn't being credited for specifying a far-future Expires header when it was sent as expires: ....

Now that I have the opportunity to check out the code I see that there are a bunch of places where a specific casing is assumed, for instance:

https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L311
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L372
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L406
https://github.com/marcelduran/yslow/blob/master/src/common/component.js#L413

... and many more.

My suggestion is to do the same as node.js' http module: Lowercase all the header names before they're added to the hash, and always look for the lower cased version. I will happily try to whip up a pull request, but wanted to ask first :)

CSS3 multiple backgrounds support

YSlow is currently picking only the first occurrence on a multiple background CSS3 property.
It used to cause false 404 offender entry on yno404 rule and on css images at components tab, but it was fixed on issue #7, however the css images count is still wrong, no matter the number of background image urls, it always count 1, ignoring the remainder.

A few useful links:

yjsbottom rule don't work with phantomjs

Seems like the yjsbottom rule don't work running yslow with phantomjs (Mac Os X):

phantomjs yslow.js http://www.apple.com

gets the response

...
"yjsbottom":{"score":100,"message":"","components":[]}
...

but there are actually 8 js that are found in head, all found running yslow in Chrome.

PhantomJS: yfavicon rule appear not to work with phantomjs

Running on Mac OS X:

phantomjs yslow.js http://www.facebook.com

gives the following output:

...
"yfavicon":{"score":95,"message":"Favicon is not cacheable","components":[]}
...

and then later in the output, it seems like the size is 0 & no response headers:

{"type":"favicon","url":"http\u00253A\u00252F\u00252Fstatic.ak.fbcdn.net\u00252Frsrc.php\u00252Fyi\u00252Fr\u00252Fq9U99v3_saj.ico","size":0,"resp":null,"headers":{"response":{}}}

Checking the header in the browser, it gives me:

Cache-Control   max-age=2592000

Get the same with all sites I have tested. Anyone else that have this problem?

Constant CPU usage even while firefox is "idle"

Constant CPU usage even while firefox is "idle"

Looking at top while firefox is running, but not being used :

  • If YSlow! is installed and enabled, usage is constantly around 4 to 5% minimum, typically 4.3%.
  • If YSlow! is not installed, or installed but disabled, typical cpu usage is 0.3% -- as expected

YSlow 3.1.4
firefox-16.0.2-1.fc16.x86_64

Scoremeter only applicable to YSlow2 ruleset

  1. run "Classic" ruleset
  2. click Tweet
  3. copy the URL, paste in a new tab

All non-classic rules are 100%

Suggestion: hide Like/Tweet if not in YSlow2 ruleset. Or in Scoremeter hide rules that were not passed in the URL

For custom rules and custom weights though, scoremeter doesn't know anything, so tweet/like should not be there

IE compatible

YSlow Bookmarklet should be IE compatible. Haven't tested on these browsers.

YSLOW.firefox.Preference.getPrefList possibly causing Firefox slowdowns

https://bugzilla.mozilla.org/show_bug.cgi?id=777397 was reported by a Firefox user experiencing frequent browser hangs. Profiling with the Gecko Profiler showed a large amount of time spent in YSlow 3.1.2's getPrefList function, called by YSLOW.firefox.startup.

I notice that YSLOW.firefox.startup calls itself repeatedly in a timer loop until it successfully registers with Firebug. Could this be going wrong somehow, causing this loop to continue forever? Could this be mitigated by moving the getPrefList call out of the loop, and/or aborting if the loop has continued too long?

yimgnoscale rule should allow for some scaling of images

In responsive design images are typically set to width 100% so that they fill their container where as yslow expects the image dimensions to be specified to meet the image.

Image should be appropriate for their viewport size (obviously we want to avoid very large images being scaled down in the browser) but some allowance should be made for scaling images i.e. if an image is designed for a 320px wide viewport and it's scaled down when it's used in a 300px wide viewport.

YSlow per region

This feature allows YSlow to run performance analysis on a specific or multiple regions on the page. This is useful to get scores from parts of the page besides the overall page score.
Regions can be defined as any DOM element containing the desired block on page.

Sample usage: get YSlow score for middle column in a multi-column page where it contains media/news and also get score for rightmost columns where ADs are displayed. This might result in grade A for media/news and C for ADs while the overall page score is B.

This feature combined with YSlow interfaceless (issue #11) and Boomerang plugin (issue #12) might be even more useful.

Primed Cache graph appears incorrect

From [exceptional-performance] list:

When I run YSlow against a variety of pages on our site the graph for primed cache reports that the TotalWeight for HTML/Text is 0.0 for size. When I look in the Components section and see that the html show nothing in the Expires column. This is confusing some of my users. They think that we have configured either the pages or the web server to allow caching of HTML and I know from looking at the headers that Cache-Control is set to no-cache.

Has anyone else encountered this and is there a 'correction' in the works?

Thanks in advance,

Mark

JDrop integration

Export results (JSON) to JDrop. This is a must have integration for mobile (bookmarklet) for better post viewing and analysis on desktop.
Currently YSlow exports (fires beacons) with pretty much all information (beaconInfo=all), not sure if this is enough to recreate the performance analysis report back from this info.
More details on JDrop integration: http://jdrop.org/devdocs

Enable Tools tab

Tools tab is only available on Firefox Add-on, it should be included in all other flavors (browser extensions).

Rhino throws uncaught JavaScript runtime exception: ReferenceError: "window" is not defined

I cloned the repo and tried to run Yslow in Rhino with the following:

make
cd build/rhino
java -jar rhino.jar yslow.js http://example.com/

and got this:

js: uncaught JavaScript runtime exception: ReferenceError: "window" is not defined.

In several Google groups some extra parameters were suggested, for example -opt -1 which I tried too.

java -jar rhino.jar yslow.js -opt -1 http://example.com/

Same thing.

Is this a bug or am I doing it wrong? My skills in env.js is too brief for me to find it out myself.
If it works, please describe the correct use with Rhino here and update the README with Rhino instructions.

Windows Script Host support

WSH (Windows Script Host) is already an unlisted YSlow flavor

make wsh

It's supposed to work with .har files as nodejs flavor does.
Currently it's only working with default settings, i.e.: it's not accepting any user-defined parameter. Argument parsing is missing in order to fully support WSH.

Rhino support

rhino is already an unlisted YSlow flavor

make rhino

It's supposed to work with .har files as nodejs flavor does.
Currently it's only working with default settings, i.e.: it's not accepting any user-defined parameter. Argument parsing is missing in order to fully support rhino.

Does not load with FireBug 1.10.1

YSlow 3.1.0 does not load as a tab in FireBug 1.10.0.

This issue only occurs with this version of FireBug as I rolled back to 1.9.2 and YSlow appears correctly.

JSLint on build process

Integrate JSLint on build process using as many options as possible.
Any JSLint error should break the build.

YSlow interfaceless

Create a new YSlow flavor where the interface is completely removed. The idea is to have a standalone piece of script that could be injected into any page to analyze dynamic generated content (where content is served differently per user or pages are user customized). After analyzing, the results should be sent to a server (beacon). This is similar to measuring real user page load time from instruments like Boomerang.

Does not work with Firebug 1.10.0 in Firefox 13.0.1

Since Firebug updated itself to Version 1.10.0, YSlow doesn't do a thing anymore. Clicking the YSlow icon, sometimes open a garbled firebug panel, but most of thime, nothing happens.

Someone opend a bug for firebug for this issue, so i thought i rather file the issue here.
http://code.google.com/p/fbug/issues/detail?id=5693

Is there a way that i can provide you with better debug/bug info?

I'm using the addon from addons.mozilla and run firefox/YSlow on linux (ubuntu).

Yslow support for SPDY

I've been using SPDY via google's mod_spdy, and it seems to work fine. The only downside is that SPDY seems to do its own compression, so they don't appear as gzipped components and thus yslow complains, so I get a lower score with a site delivered with SPDY than without!

I'm fairly sure this is what's happening - if I request the same item without spdy, it does get Content-Encoding:gzip headers set.

Is yslow likely to get SPDY support soon?

Include initial url in beacon

It would be useful to include the initial url (before redirects) in the beacon alongside the url analyzed.

PageSpeed includes this bit of information in its full beacon. It is implemented using the FF's nsIObserverServiceIface to build a table of URLs. Firebug also uses this service for its Net panel.

I'll try to come up with some code.

junit format results in invalid XML

When a page also generates some kind of JavaScript error or warning, the error message is printed to stdout. If you also requested --format junit, it will then print the XML content after those error messages. The result is that the XML file cannot be parsed because it begins with non-XML content. The actual error (in Jenkins) is:

Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.dom4j.io.SAXReader.read(SAXReader.java:465)
    ... 18 more

The problem is that the console messages are not isolated from the output report file. Is there a way to instead specify the report file via command line argument, instead of redirecting stdout to the report file? Or change the console messages to go to stderr, and leave stdout as just the report file.

Enable Auto-Run

Auto-Run is only available on Firefox Add-on, it should also be available for other flavors (browser extensions).

YSlow does not load in Firebug 1.10.1 and Firefox 15

Clicking the YSlow icon opens a smal panel at the bottom of the browser with a Run YSlow button that does nothing and a close button that works. YSlow menu header no longer shows in Firebug menus. Have un-installed and re-installed but this does not fix the issue.

i18n

Add i18n support through translation bundle files.
There's already an initial work on src/common/doc.js file, some design review is highly recommended in order to support language packs (bundle).

Enhance beacon info

YSlow was first designed for Firefox only, now being supported by other browsers/environments the beacon info should contain:

  • UserAgent string
  • YSlow version

Installing for Firefox

Hi,
Thanks so much for open sourcing yslow! I am trying to figure out how to install the firefox 'flavor' after cloning the repo.

I run make firefox, and it generates the package (firefox directory is created with .rdf file). But inside firefox I choose to Install add on from file, and I cannot get it to install.

Thanks for any help.
Dave

Chrome should use webRequest API rather than x-domain AJAX

Chrome extensions now officially support webRequest API. It should be used in replacement of x-domain AJAX. The API is pretty simple:

chrome.webRequest.onSendHeaders.addListener(function (details) {
    console.log('headers sent', details);
}, {urls: ['*://*/*']}, ['requestHeaders']);

chrome.webRequest.onHeadersReceived.addListener(function (details) {
    console.log('headers received', details);
}, {urls: ['*://*/*']}, ['responseHeaders']);

chrome.webRequest.onCompleted.addListener(function (details) {
    console.log('completed', details);
}, {urls: ['*://*/*']}, ['responseHeaders']);

However, it doesn't seem to expose the content retrieved, therefore x-domain ajax should still be used for this particular task on non-binary content.

Unit test

Create unit test initially for:

  • YSLOW.util
  • YSLOW.rules

Any error should break the build process

UPPER-CASE headers should be interpreted

We have a somewhat klunky web server that generates headers like this:

CONTENT-ENCODING:GZIP
LAST-MODIFIED:16/Feb/2012:20:28:53

The browsers seem to recognize this, but YSlow does not -- it reports the file as uncompressed and without an expiration date

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.