Skip to content

Instantly share code, notes, and snippets.

andydavies / resourcesperpage.sql
Created Apr 18, 2012
Extracts data to plot a histogram of resources vs count of pages from HTTP Archive data
View resourcesperpage.sql
-- Extracts data to plot histogram of resources vs count of pages from HTTP Archive data
-- For bigger groupings change ROUND(resources, 0): -1 = 10, -2 = 100
SELECT ROUND(resources, 0) AS ResourcesPerPage,
COUNT(*) AS Pages
FROM (select count(*) as resources from requests group by pageid) as temp
GROUP BY ResourcesPerPage;
andydavies / gist:2517046
Created Apr 28, 2012
Find icons in HTTPArchive.ord data
View gist:2517046
-- Find the favicon in data
-- TODO: filter just of favicon.ico (still need mimetype?)
select * from requests where mimeType = 'image/x-icon'
andydavies / gist:4358912
Created Dec 22, 2012
View-Source bookmarklet for webkit (only ?) browsers works on iOS Safari e.g. iPad too Based on @weisjohn's bookmarklet with background colour forced to white (
View gist:4358912
javascript:(function(){i=document.createElement('iframe');i.setAttribute('viewsource');i.setAttribute('width', '100%');i.src=location.href;document.body.insertBefore(i, document.body.childNodes[0]);'#fff';})();
andydavies / gist:5489399
Created Apr 30, 2013
Quova API example - when tested it didn't support IPv6 and cellular gateways were always reported as line_speed:low regardless of end user connection
View gist:5489399
"organization":"vodafone limited",
"carrier":"vodafone limited",
"connection_type":"mobile wireless",
View gist:5917537
andydavies / gist:6006984
Created Jul 16, 2013
DNS records for publish and but connections to fail so effectively waiting for TCP timeout before resolution
View gist:6006984
Andy-Daviess-MacBook-Pro:tmp ad$ wget
--2013-07-16 09:33:56--
Connecting to||:443... failed: Operation timed out.
Connecting to||:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: [following]
--2013-07-16 09:35:13--
Connecting to||:443... connected.
View gist:6024703
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:> for detailed information.
# In particular, see
# <URL:>
# for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding
andydavies / gist:8653127
Created Jan 27, 2014
List of Web Perf Resources for
View gist:8653127
- Enable gzip - HTML 5 Server Configs has examples for 1 & 3 (perhaps 2) -
- Enable keep-alive
- Set explict cache-lifetime
- Optimise images i.e. pick an appropriate format and run through tools like ImageOptim, JpegMini etc.
- Get a build process that minifies CSS & JS, and can combined multiple files together where appropriate
- Consider dataURIs or CSS sprites to reduce the number of requests for small images
- depending of where audience is consider a CDN (latency is the enemy in all of this
View gist:42dcdd49d21a6ad1b26e
# Parses JSON results from WPT e.g.
# Relies on JSON to be locally downloaded first (avoid's timeouts when results need to be retrieved from archive)
# Produces a data.frame with selected values from all test results
# url in code is really a path to a file, all.urls is a data frame with a list of files
View gist:abcca48135ef85e4af7b
1. Install nginx
sudo apt-get install nginx
configure nginx.conf
2. Install PHP
# Fast socket version
You can’t perform that action at this time.