Drupal

Front End Performance Strategy: Image Handling

Jason Stanbery writes on performance. Interestingly a lot of performance is on the front-end, not back-end:

Business is keenly aware of the importance of page-load time, and its impact on conversion and search engine optimization. It’s now a priority at companies like Wal-Mart, Amazon, and Mozilla.

At Acquia, we hear about it from virtually every customer. They all want to know how our platform and services can improve the performance of their websites. How much can we speed up the responsiveness of the digital experience they are offering their users and customers.

Performance is often considered to be primarily a back-end problem, but frankly what we find after we dig through back-end code: often poor front-end optimization is the culprit and not Drupal itself.

Lots of useful things in this post, and a helpful hint:

We see a lot of designers and developers getting around responsive challenges by simply loading a larger image then necessary, not declaring dimensions on the image, and scaling the image using styles.

Instead, we should use our current best option, Drupal’s Picture Module.

Code quality guidelines for large Drupal projects

Neerav Mehta writes about Drupal code quality, many good tips:

Are you wonderig what code quality guidenlines your Drupal developers should follow in addition to Drupal's coding standards to make the code readable, secure and performant? What are the best practices so that developers can follow each other's code easily and make code review faster?

How to Contribute to Translations in Drupal Projects

Amber Matz discusses how to help with translating in Drupal project:

There are many layers of translatable text on a Drupal site.

First, there are the many user interface (UI) elements that contain text. For example, the Log In button, Add New Comment link, and the Home menu item. These are examples from Drupal core, but any contributed module or theme can contain additional translatable UI elements. If the developer of a contributed module or theme wrapped UI text in t(), then that text is translatable.

Next, there's the content itself, as well as any custom UI elements you add to your site, like menu items. I won't cover that topic in this lesson. ...

In this lesson, we explore how to contribute translations to those out-of-the-box UI elements that are part of Drupal core or any contributed project.

Global Redirect Module

Jim Birch discusses the global redirect module:

... What we are missing is that those original URLs still remain live on the internet, and can be considered duplicate content, a detriment to good SEO. Global Redirect automatically sets up 301 Redirects for both of the old URL schemes, to the new friendly URL.

Managing Variables in Drupal 7

Dave Hall writes about managing variables in Drupal 7:

A couple of times recently the issue of managing variables in Drupal 7 has come up in conversation with other developers. This post outlines the various ways of managing variables in Drupal sites. The three things this guide ensures:

  1. Sensitive data is kept secure
  2. Variables are correct in each environment
  3. You are able to track your variables (and when they changed)

Dependency Injection with Traits in Drupal 8

Amber Himes Matz writes on how to discover traits using PHP Storm, but what she finds is useful to know for all Drupal 8 developers. This is the code she was writing:

$url = Url::fromRoute('form_fun.cake_page');
$text = 'Death, or cake? (The basics)';
$links[] = \Drupal::l(t($text), $url);

But by poking in Drupal she finds out she can actually write:

$links[] = $this->l($this->t('Death, or cake? (The basics)'), new Url('form_fun.cake_page'));

Read the article to find out why and how this works.

War story on optimising a performance issue with a Drupal site

Peter Mallett dives into a recent case where his company had to solve a huge performance issue with a Drupal site:

This system was designed and implemented before we ever got to look at it and had been running for some time. These modules were installed for “performance reasons”, according to the documentation: boost, advagg, entitycache, memcache, and CDN. While these modules do all have their place and usefulness, they were mostly not a good fit for this project.

These modules make the system more complex compared to a plain Drupal setup, especially regarding stack tracing and profiling. These modules each implement optimization techniques and all come with side effects which make debugging and maintenance more complex.

...

It was only after removing almost all of these elements from the system (and still experiencing the performance issue) that a colleague was able to determine that the bottleneck we were looking for was in an area completely unaffected by any of these modules and fix the problem.

We fully agree with his closing statemement: "Don't spend time on premature optimization, and actual optimization will cost less. It's a win-win for clients and developers."

Weekly Module Review - #1 Focal point: A different way to crop an image.

Drupal comes with basic image cropping tools, but Focal point is a very interesting addition. Davide Sanfilippo highlights this module:

If now we create a new node, after inserted the image on the field previously created, it will show a cross (+). Dragging it, you can select the area where focus the Crop.

Making Drupal 8 fly

Dries writes on making Drupal 8 fly:

In my travels to talk about Drupal, everyone asks me about Drupal 8's performance and scalability. Modern websites are much more dynamic and interactive than 10 years ago, making it more difficult to build modern sites while also being fast. It made me realize that maybe I should write up a summary of some of the most exciting performance and scalability improvements in Drupal 8. After all, Drupal 8 will leapfrog many of its competitors in terms of how to architect and scale modern web applications. Many of these improvements benefit both small and large websites, but also allow us to build even bigger websites with Drupal.

Recommended reading.

Panels, Blocks, Layouts, and Drupal 8

Addison Berry writes on "Panels in core" or "Blocks everywhere" or "Layout all the things!" and what this all means:

The end goal basically boils down to two main pieces: turn all page output into blocks (using the new plugin system), and add a new layout system that will allow site builders to control their pages. Pretty awesome, huh? Also, a lot of work.

...

With plugins in core, the next step was to get all of the existing Drupal blocks switched over to the new system. Using the plugin system turned the old, pokey core blocks into flexible super-blocks. This allows us to to do cool things like have multiple instances of a block. This was a huge amount of work by a lot of people. It took about a year to get the "blocks as plugins" foundation in place.

Good update and overview on what's behind the changes in Drupal 8.