Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
curl --silent http://example.com/sitemap.xml | xpath -q -e "/urlset/url/loc/text()" > tmp.urls && siege -v -c 1 -r `cat tmp.urls | wc -l` -f tmp.urls
@mklooss
mklooss / pagespeed-requirement.vcl
Last active October 5, 2020 20:00 — forked from section-io-gists/pagespeed-requirement.vcl
Using the PageSpeed module alongside Varnish, you will need to configure Varnish to handle PageSpeed optimizations.
# Note: You will want to add the snippet: `include "pagespeed-requirement.vcl";` above your `vcl_recv` in the default.vcl file.
sub vcl_recv {
call pagespeed_capability_detection;
}
# Function derived from requirements here https://modpagespeed.com/doc/downstream-caching#ps-capabilitylist
# Additional detection logic for crawlers, tablet and mobile devices.
sub pagespeed_capability_detection {
if (req.http.User-Agent ~ "(?i)Chrome/[3][2-9]+\.|Chrome/[4-9][0-9]+\.|Chrome/[0-9]{3,}\.|Firefox/([6-9][5-9]|\d{3,})\.") {