The ultimate guide for faster Drupal: Part 2: Aggregation, CDN and Image Optimization

Drupalutvikler, prosjektleder og designer
Drupal performance with Ramsalt

We are on our journey to master the Drupal performance, after having our previous Part 1: Caching published a couple of weeks ago, we've been lucky enough to get into Issue 386 of TheWeeklyDrop newsletter(link is external), Planet Drupal(link is external), and got much love and good feedback on Twitter.

If you haven't already read the first part of the series, the ultimate guide for faster Drupal: Part 1 Caching, please feel free to read that article too.


Note: You don't necessarily have to do all of these, some items listed here are replaceable with each other as well, so proceed with caution!

Faster Drupal - Part 2: Aggregation and CDN

  • The one and the only holy grail: Advanced CSS/JS Aggregation
    On every Drupal optimization post you’d read you have to setup and configure AdvAgg module, but you gotta do what you gotta do!
    AdvAgg features and core benefits are listed on the module page completely, so go ahead and read them all, configure it the way that works best for you and move on
    Advanced CSS/JS Aggregation Drupal module(link is external)

    Note: If you have Mod Pagespeed you might not need AdvAgg module, make sure that you don't overlap your own workBut that’s not all, if you are on Drupal 7, you should consider checking Speedy module as well, in some areas, this might work a bit better so make sure to check it out as well
    Speedy module(link is external)
  • For good JavaScript minification in Drupal, you can use modules such as minify but we’d like to recommend minifyJS instead, they listed the differences and benefits on their module page so check it out
    Drupal MinifyJS module(link is external)
  • CDNize the whole project, as much as you can! You may use CDN(link is external) module too
  • Move JavaScript to the footer if necessary, some JS files need to be rendered in the head based on the use case and what does the JS do! Also in Drupal 8, it’s quite easy to append your necessary library (Read it JS files) in the footer in twig template files
  • Consider if you can make your own scripts defer/async(link is external) (a new challenge when it comes to Drupal js aggregation)

Okay, this round was much easier thanks to AdvAgg module for taking care of half of the things we need to do for us! Note that on the frontend side you can Uglify, Minify and make sure everything that you code, will become compressed, whether it’s CSS, JS or even images or SVG files! Now let's get to it, Image optimization. 

Image optimization

Bonus tip: Even favicons should be optimized. Sometimes people ignore the weight of a favicon file. You shouldn’t! 

For the next week, we will be covering subjects regarding Drupal database/web server tweaks & improvements, stay tuned.

Latest news

Ramsalt Lab, one of Northern Europe’s leading web development agencies, is pleased to announce a new phase of growth with strategic changes to its leadership team.

Ramsalt is a people-first, remote-first agency built on Scandinavian values of openness, responsibility, and trust. We work with mission-driven clients — from NGOs to universities and publishers — and care about clean code, real collaboration, and a sustainable way of working.

A personal photo of Stephan Ziedler
Stephan Zeidler

Vi ser etter en prosjektleder som elsker å jobbe med både mennesker og teknologi – en som trives i dialog med kunder og teamet, og evner å holde roen og oversikten når tempoet er høyt. I denne nøkkelrollen vil du drive komplekse webprosjekter fra idé til vellykket lansering, med et kontinuerlig fokus på fremdrift, kvalitet og fornøyde kunder.

Nina
Nina Holzapfel

At Ramsalt, we're always working together with you to enhance your website, its features and content to better engage your audience.

Nina
Nina Holzapfel