I would be willing to bet that I have worked more on page performance than anyone. Foundation 6 is damn fast. I can say that confidently because I have spent many weeks shaving microseconds off on as much as I can. I am working on a new homepage for F6. It currently has a score of 94. I am pretty confident I can get this to 100 since most of my errors are on image size and I have done zero optimizations on my images so far.
There are many things that are completely out of our control. However, there are things that could be done by RapidWeaver or us developers as a group. Here is a random brain dump, in no particular order.
Image Size + Compression
There isn’t much that RapidWeaver can do to help here. One thing that could be nice is to warn people when they are uploading files that could be too large. I had a guy just yesterday have over 50MB of images on one page. I investigated the JS performance APIs to see if I could build some early warning mechanism. However, it does not expose the size of resources on the page, only timing. Sad.
I do not think that RW should try and optimize on behalf of the user though. Many users (including myself) do not like optimization forced on me. However, maybe some kind of option could be enabled. Which would mean that it would probably need to be turned on by default for new users since they are the ones that don’t know what they are doing.
Many users are not aware of new formats for the web like webp. Maybe if someone adds an image into Resources, you could have a warning about size and format? Maybe an option to optimize inside Squash directly from Resources?
jQuery 3
This one is pretty much on us developers. Google warns about jQuery 2 but it’s a pretty minor security risk to be honest. Many of my products work in jQuery 3 but many others do not. It’s a lot of work. But it needs to get done.
JS at the Bottom
RW already has %plugin_header%
for the theme API. However, why does it not have a %plugin_footer%
API? This could be used so that the plugins can expose the JS script tags. I know that there is a extraBodyHTML
in the plugin API. However, this does not expose anything for the themes to have control over where things go.
In order to keep backwards compatibility, there would need to be a setting in the theme plist that states the theme needs the header and footer separately. Or else everything should go into the header.
Foundation 6 has is own async loader that I have engineered. It will asynchronously load CSS in the head and all of the JS at the bottom. With my suggestion above, I wouldn’t really need that.
3rd party embeds
Not much any of us can do here. If people place embed codes on the page, the page performance will suffer. Most services do not follow good performance practices and it does hurt page speed scores.
Unused Code
Google will warn about unused code in both CSS and JS. I don’t really see how this can be optimized. There are build tools out there that can remove unused code like PurgeCSS. I just don’t see how this can be integrated into RapidWeaver. It’s a command line tool that requires you have tons of developer tools installed.
As developers we can try our best to only load external libraries when needed. I see so many themes load tons of fonts and libraries regardless if they are being used. I guess a better theme API could help with that.
Code minification
I minify the code in all of my stacks as much as possible. I think at one time RW tried to further minify published files but it was a failure. Many times minifying code that has already been minified produces errors.
Caching
Another common error is caching age of static assets. There isn’t much RW could do here since it’s a server policy. You can define a lot of this in your htaccess file. Maybe supplying users with htaccess snippets could be a nice thing to have.
I always thought that it would be cool to be able to ship snippets in my theme or stacks so that RW could read them in. Because they are in a theme/stack, they are then updatable.
I should add that RW’s cache busting links is good.
Gzip compression
Any good hosting company should be gzipping all network requests. Many cheap hosts don’t. Nothing we can do about that. I promote Cloudflare which does this for users if their host does not.
Excessive DOM size
This one is on us developers to code our stuff as optimized as possible. However, It’s ultimately up to the users in not adding 500 stacks to the page. You don’t need to jam everything onto one page.
I am sure that there is more to talk about but that is most of it… hope this helps.