I’m not only into optimizing the speed of sites with for the benefit of their visitors, but also into speeding up all sites in my browser, to satisfy my own impatience. I already blocked Facebook, Twitter and Google+ widgets using NoScript’s ABE and now added this little snippet in ABE’s user ruleset to stop Google Fonts from being loaded;
# no google fonts
Earlier today I got this question on the wordpress.org support forum for Autoptimize;
Will there be Google fonts support in the future? I now include the google font’s like this:
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,700,600|Varela+Round' );
Is it possible to add this css to the combined and minified by this plugin file?
The basic question if Autoptimize can aggregate external resources has been asked before and I felt it was time to dig in.
I did a little test, requesting the same Google Font CSS, changing browser user agents. For my good ole Firefox on Ubuntu Linux I got (snippet);
font-family: 'Open Sans';
src: local('Open Sans'), local('OpenSans'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
Whereas the exact same request with an MSIE7 useragent gives (again, extract);
font-family: 'Open Sans';
It’s not surprising Google has specific CSS based on browser useragent (probably browser-version), but this is a simple example of how dynamic remote CSS or JS can be (the scala of variables that could lead to 3rd parties serving up different CSS/JS is huge, really).
So although theoretically it would be possible to have AO cache remote JS/CSS (such as Google Font’s) and include it in the aggregated CSS- or JS-file (and that way removing render blocking resources), the problem is that AO will never be able to apply whatever logic the 3rd party applies when getting requests. Hence the design decision (made by the original developer, Turl, a long long time ago) not to aggregate & minify external resources. This is how it should be.
The future is bright, you’ve got to wear shades? But why do those promises for a better future thanks to technology often fail to materialize? And how is that linked with the history of human flight, folding paper and the web? Have a look at “Web Design: first 100 years”, a presentation by Maciej Cegłowski (the guy behind pinboard.in). An interesting read!
So I’m currently working on “power-ups” for Autoptimize, which I might commercialize later this year. Some examples of functionality I’m developing;
- Excluding specific parts of your site from optimization (JS+CSS+HTML, JS-only or CSS-only), all from a simple configuration-screen
- A settings-page to configure “above-the-fold”-CSS for specific pages
- A power-up to speed up optimization itself (especially interesting if you don’t have a page caching plugin)
Drop me a line If you’re interested in beta-testing these power-ups, with a small description of where you would run this beta.
So web is going away, being replaced by apps? Forrester researched and does not agree;
Based on this data and other findings in the new report, Forrester advises businesses to design their apps only for their best and most loyal or frequent customers – because those are the only one who will bother to download, configure and use the application regularly. For instance, most retailers say their mobile web sales outweigh their app sales, the report says. Meanwhile, outside of these larger players, many customers will use mobile websites instead of a business’ native app.
My biased interpretation; unless you think can compete with Facebook for mobile users’ attention, mobile apps should maybe not be your most important investment. Maybe PPK conceeded victory too soon after all?
Thanks for sharing Nicolas :-)