Notes on optimizing page load time in Drupal, from David Valdez

Initial implementation notes for “Improve site performance” for the original Find It Cambridge project.

Eliminate render-blocking JavaScript and CSS in above-the-fold content Accord with:

The way to do this is move the most critical parts of the scripts and put them inline, later add a script that loads the rest of the scripts.

And for Javascript it suggest to add the async attribute in the tags which could be problematic because if the js depends of a different script in order to work this could break the functionality.

So we would need to stop relying on Drupal to print the scripts and do it manually.

This will take a good amount of time, I would say 20 points.

Leverage browser caching

This shouldn’t take too much, the changes needs to be done at the htaccess level, I would say 1 or 2 points.

https://varvy.com/pagespeed/cache-control.html

Enable compression

This is already configured and working for the javascript and the CSS files, we might want to do it for other type of files, (like SVG)

I think this should take 1 point.

https://varvy.com/pagespeed/enable-compression.html

Optimize images

There is a Drupal module for that, it can be configured to use different tools to optimize the images uploaded by the users:

https://www.drupal.org/project/imageapi_optimize

I estimate 2 points to do make sure that the compressed images aren’t loosing quality and test a few tools to see which optimize better the images.

I found this article for Drupal 8 but there is also a version for D7.

https://www.previousnext.com.au/blog/better-image-optimisation-drupal