Drupal

9 April, 2015

After more than a year and probably hundreds of patches, yesterday it finally happened! As of 13:11:56 CET, April 8, 2015, Drupal 8 officially has page caching enabled by default![^1] And not the same page caching as in Drupal 7: this page cache is instantly updated when something is changed.

The hundreds of patches can be summarized very simply: cache tags, cache tags, cache tags. Slightly less simple: cacheability metadata is of vital importance in Drupal 8. Without it, we’d have to do the same as in Drupal 7: whenever content is created or a comment is posted, clear the entire page cache. Yes, that is as bad as it sounds! But without that metadata, it simply isn’t possible to do better.1

I’ve been working on this near-full time since the end of 2013 thanks to Acquia, but obviously I didn’t do this alone — so enormous thanks to all of you who helped!

This is arguably the biggest step yet to make Drupal Fast By Default. I hate slow sites with a passion, so you can probably see why I personally see this as a big victory :)

7 April, 2015

I’m working on making Drupal 8 faster as part of my job at Acquia. The focus has been on render caching12, which implies that cacheability metadata is of vital importance in Drupal 8.

To be able to render cache all things that can possibly be render cached, Drupal 8 code must:

  • set the right cache max-age — to ensure only the cacheable parts of the page are cached
  • set the right cache contexts — to ensure content is varied as expected (per language, per role, per timezone, per user â€¦)
  • set the right cache tags — to ensure rendered content is invalidated when the data it depends on is modified

Before Drupal 8, approximately zero attention was given to cacheability of the rendered content: everything seen on a Drupal 7 page is rendered dynamically, with only the occasional exception.

By flipping that around, we make developers more conscious about the output they’re generating, and how much time it takes to generate that output. This in turn allows Drupal 8 to automatically apply powerful performance optimizations, such as:

7 November, 2014
Description

In Drupal 8, we’ve significantly improved the way pages are rendered. This talk explains the entire render pipeline, in some detail.

But it also covers:

  • render caching — blocks and entities are now render cached automatically!
  • cache tags — finally we have the cache invalidation system we’ve always needed!
  • assets — only the necessary assets are loaded anymore, thanks to asset dependencies!
  • bubbling — rather than relying on global statics that broke caching, we now correctly bubble up all attached metadata — no more frustrations!

Besides that, I also cover a few of the most interesting new possibilities in Drupal 8:

  • anonymous page loads: invalidating Varnish/CDNs with perfect precision
  • authenticated page loads: not completely regenerated on every page load, but assembled from render cached parts
  • alternative render strategies, like Big Pipe

Update (November 14, 2014): since I gave this talk, https://www.drupal.org/node/2352155 was committed, so this talk is now indeed a comprehensive, correct talk about the finalized Drupal 8 render pipeline!

Update (March 20, 2015): there is now an official Drupal 8 documentation page: https://www.drupal.org/developing/api/8/render/pipeline.

Conference
DrupalCamp Ghent
Date
Location
Ghent, Belgium
Duration
45 minutes

Tags

2 October, 2014
Description

Together with Fabian Franz & Marco Molinari from Tag1 Consulting, I had a session about render caching in Drupal 7 and 8 at DrupalCon Amsterdam.

Marco explained the render performance problems in Drupal 7, the way the Render Cache module for Drupal 7 mitigates these performance problems as well as possible in Drupal 7, but can’t solve everything, because the necessary mechanisms to solve it properly aren’t available there. I explained how cache tags in Drupal 8 have fixed this problem in Drupal 8 completely. And Fabian demonstrated very cool things for the near future: different rendering strategies, such as Facebook’s Big Pipe — which already works in the render_cache module for Drupal 7, and will only be simpler to implement in Drupal 8!

Conference
DrupalCon Amsterdam
Date
Location
Amsterdam, The Netherlands
Duration
45 minutes
5 January, 2014

This year, Performance Planet did an advent calendar again, just like the last few years. I also contributed an article — what follows is a verbatim copy of my “The real challenge: making the entire web fast” article for the 2013 Performance Calendar.

Probably many — if not most — of us speed freaks work for big companies that are optimizing top 1,000 websites.
Some companies have the budgets to hire people who work on WPO full time. Those companies are able to do that thanks to huge revenues — otherwise it would not be financially justifiable. In other words: they’re probably a top 1,000 website. The percentages of page speed improvements those people bring must translate into sufficient additional revenue to cover their wages.
Other companies have people who get to spend part of their time on WPO, and maybe pay for the services of one of the several WPO companies out there. But even in this case, a sizeable revenue is a requirement to justify it.

So what about the millions of other websites?

7 December, 2013
Description

For this short talk, I chose two particular improvements in Drupal 8 that will make a big difference for future Drupal sites’ performance and ops (infrastructure requirements).

The addition of cache tags is the most important new feature to have a huge impact on back-end performance: it allows for much smarter/better cache invalidation, and hence through better cache hit ratios help increase performance and reduce infrastructure requirements.

On the other hand, the move towards a pluggable asset optimization system (instead of the non-pluggable one in Drupal 7) allows for much greater flexibility in adjusting the asset optimization pipeline to suit a specific site’s needs. Changing the JS minifier or even the complete asset optimization pipeline will become easy, whereas in Drupal 7 you’d need incredibly intricate knowledge of other Drupal internals — making such front-end performance changes much more expensive than they should be.

Neither helps current production sites on Drupal 7 since they’re major improvements in Drupal 8, but both solve fundamental flaws in previous versions, so they will probably make you (even more) excited about Drupal 8!

Note: these slides are a shortened version of my Building really fast websites with Drupal 8 talk — but presented from a different angle and with a different focus.

Conference
Drupagora 2013
Date
Location
Paris, France
Duration
25 minutes
25 September, 2013
Description

Drupal 8 is going to have better front-end performance for anonymous users out of the box: it is now smart enough to no longer load unnecessary JavaScript. It’s also (finally!) going to cache all entities efficiently, so that it doesn’t waste time rerendering the same content over and over again.

Because less time needs to be spent on generating the HTML, the page will show up faster on visitors’ devices — also mobile devices.

However, you of course still want pages to be personalized. Different visitors have different permissions (and hence different contextual links), different interests (and hence have “new” or “updated” indicators in different places), and so on. In Drupal 8, we’ve introduced the necessary foundations to easily serve the same HTML (well, >90% the same — i.e. the most expensive parts), yet still personalize the page by using client-side caching (localStorage/sessionStorage) in combination with clever client-side cache invalidation.

Furthermore, we finally have pluggable CSS and JavaScript optimization (aggregation), where you can easily plug in a specific JS minifier, or data-mining-applied-to-visitor-navigation-paths-powered CSS/JS grouping (to calculate globally optimal groups)!

The end result: really fast websites, with superb perceived performance!

Note: where possible, I’ve explained how to achieve the same in Drupal 7.

Conference
DrupalCon Prague
Date
Location
Prague, Czech Republic
Duration
50 minutes
7 July, 2013

What?

This article proposes a novel, simpler way of managing Drupal sites (where “managing” in this case is solely code updating & deployment).

It relies on only one command-line tool: mr (“a Multiple Repository management tool”, http://joeyh.name/code/mr/), plus a Drupal plug-in for that tool: mr-drupal, https://github.com/wimleers/mr-drupal.

Why?

If you run Drupal sites, you need some way to manage them; some way to keep them up-to-date. As of Drupal 7, there’s a built-in update manager, but it doesn’t use a VCS.

Most likely, you want use a VCS to manage your Drupal site. You may be downloading tarballs and checking their contents into your VCS, or maybe you’re using git submodules or even git-subtree. For all of these, there’s a whole lot of process, a lot of steps, a lot to learn, and a lot of tricky things you have to think about each time you want to update something. Too much that can go wrong.

31 May, 2013

Drupal 8 will ship with big authoring experience improvements: WYSIWYG editing & in-place editing, thanks to the Spark distribution that Acquia — my employer — is sponsoring.

But how well does it fare with the growing importance of structured content? Do Drupal 8’s WYSIWYG & in-place editing enable it or prevent it?

The new web world order: many form factors

The Big Thing of the last few years: the advent of mobile. Inherent to that: websites that are optimized for mobile devices and act as data providers for apps.

A new form factor — mobile devices — changed web development forever. Before mobile, the life of web developers and authors (content creators) was relatively simple: make sure websites work well on a few typical screen sizes (let’s deny the existence of Internet Explorer 6 and all the misery it caused).

But … we cannot predict what’s next. We cannot predict new content consumption form factors. That’s where content strategy becomes vitally important:

content strategy is to copywriting as information architecture is to design