2022 Developer Survey is open! Take survey.
44 votes
Accepted

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

The README has a guide on how to do this using current 7.x-2.31+ version of AdvAgg. Also see this wiki page on the High performance group. Most sites can achieve a perfect 100/100 score on https://...
user avatar
  • 8,202
27 votes
Accepted

Are there any performance comparisons?

No, there is no reliable comparison, because doing that is almost impossible. There are various reasons for that, one is that D8 vanilla is like D7 vanilla + a whole bunch of modules, especially views....
user avatar
  • 81.3k
26 votes
Accepted

How Do I improve the performance of my Drupal7 Site?

These are notes from my experiences and might vary from what others experience. I predominantly use LAMP stack and have considered the same in my suggestions. Thumb rules for caching that I generally ...
user avatar
  • 6,483
23 votes

How do you improve Drupal performance?

These are notes from my experiences and might vary from what others experience. I predominantly use LAMP stack and have considered the same in my suggestions. Thumb rules for caching that I generally ...
user avatar
  • 6,483
23 votes

How can I make kint() load faster when debugging twig templates?

There are two other ways other users have mentioned for setting the max output levels in addition to the settings.php method mentioned in the question, plus a couple other ideas below: Create a /...
user avatar
18 votes
Accepted

How to get rid of Deadlocks and Lock time out type issues?

Read and follow this post; it assumes InnoDB. In particular, see the part saying to add the following to the settings.php file. $databases['default']['default']['init_commands'] = array('isolation' =...
user avatar
  • 8,202
17 votes
Accepted

Field Collection vs. Paragraphs

In many respects the Paragraphs module appears to be a fork of Field Collection. Functionally, the difference between the modules lies in how their respective field widgets operate. The Field ...
user avatar
12 votes

How can I invalidate a cache on a specific View?

If you know the name of the view that you want to clear, then you can clear the caches specific to that view by calling a function like the following: /** * Function to invalidate selected views ...
user avatar
  • 201
12 votes
Accepted

Difference between drupal_static and \Drupal::state?

They perform different tasks. drupal_static() only stores data for the current page load (or ajax load). For example, if you are loading something from a database table multiple times on a single ...
user avatar
  • 14.5k
11 votes

How and where would I be able to enable/disable gzip compression?

Personally, I do not like the way Drupal handles output compression; I take care of this outside of Drupal. On the Drupal site, I add $conf['page_compression'] = FALSE; $conf['css_gzip_compression'] ...
user avatar
  • 37.6k
9 votes
Accepted

What happened to Drupal's performance?

D8 requires more resources and yes, you should have hosting with opcache enabled, which is included by default in PHP 5.5. Drupal 8 has so many files because it includes symfony and other projects ...
user avatar
  • 81.3k
8 votes
Accepted

Site performance , cache not working properly

Slide #85 from my performance presentation talks about max packet size in MySQL, you need to increase that value; SET GLOBAL max_allowed_packet=33554432; or change it inside of the configuration file ...
user avatar
  • 8,202
8 votes

CSS aggregration breaks site - how to troubleshoot?

Some initial things to check: Clear the cache (if you're running advagg, clear its cache). You can end up with stale file references sometimes. Find out what's happening to the missing CSS: When the ...
user avatar
  • 163k
8 votes

How can I make kint() load faster when debugging twig templates?

Kint is not the only library that you can use for debbuging variables and twig templates. I suggest to use Symfony var-dumper that IMHO is one of the most powerful lib for debuging variables. Symfony ...
user avatar
  • 1,186
8 votes

Difference between drupal_static and \Drupal::state?

drupal_static() is used to cache data within a single page request. it stores the data in a static variable. The class returned by \Drupal::state() handles values that need to be preserved between ...
user avatar
  • 93.8k
7 votes

Is there a way to force some block caching despite system block caching option is disabled?

With latest Drupal 7.33 release there is a new setting variable now: /** * Block caching: * * Block caching may not be compatible with node access modules depending on * how the original block ...
user avatar
  • 552
7 votes
Accepted

Where to render? Preprocess or template?

Drupal isn't consisting in this matter either I guess... In the default node.tpl.php variables are rendered while in other default templates (like html.php.php), variables are just printed. That's ...
user avatar
  • 163k
7 votes
Accepted

What is the fastest way to get node title from nid?

You said fastest. If you can compromise two things, this should be the fastest one. Now, note that you have to compromise: If you are only trying to get the node title, and if you are sure that ...
user avatar
  • 9,453
7 votes

How can I make kint() load faster when debugging twig templates?

FYI, as of Devel v3, you'll need to make two updates if you use the top method suggested by @chrisshattuck Go to admin/config/development/devel?q=/admin/config/development/devel Make sure "Kint" is ...
user avatar
7 votes
Accepted

How to modify .htaccess to serve brotli compressed static assets over gziped ones?

Give this a try # Rules to correctly serve gzip compressed CSS and JS files. # Requires both mod_rewrite and mod_headers to be enabled. <IfModule mod_headers.c> # Serve brotli compressed CSS ...
user avatar
  • 8,202
7 votes
Accepted

Microkernel with low bootstrap level?

A lot of the bootstrap process happens now implicitly as services are requested. If nothing requests the database service then Drupal won't open the connection to it and so on. The minimal amount of ...
user avatar
  • 81.3k
7 votes
Accepted

Why does loadMultiple load 1000 nodes 9.2 times faster than loading each node one by one?

It's likely that when you are loading individual nodes, you are loading the entity type manager, then for each node retrieve the storage, do a query to get the node data, and build the node. With the ...
user avatar
  • 14.5k
6 votes

How to get rid of Deadlocks and Lock time out type issues?

The best way to get rid of deadlock errors once and for all is the Asynchronous Prefetch Database Query Cache module. I can't recommend it enough. Brilliantly written and great performance gains.
user avatar
  • 353
6 votes

How can I avoid clearing caches when CSS changes are made?

Install AdvAgg, go to admin/config/development/performance/advagg and set "AdvAgg Cache Settings" to "Development" If you don't want to do that, go to admin/config/development/performance and uncheck ...
user avatar
  • 8,202
6 votes

Are there any performance comparisons?

There are a bunch of patches for D8 that should land before it is released. This presentation at the 2015 LA DrupalCon should explain what is happening to make sure D8 is fast. See here for an ...
user avatar
  • 8,202
6 votes
Accepted

Is there any way to cancel Panels' overlay edit windows?

I did some research and looked into Panels 3 code so far I don't see any nojs fallbacks. You can also check if there are fallbacks when you try to disable Javascript in the browser. This may not be ...
user avatar
  • 1,482
6 votes
Accepted

Bandwidth Optimization options locked

There is a problem with the public directory, it is not configured or it is not writable. You can check this with drush: drush ev "var_dump(is_dir('public://'), is_writable('public://'))" Result ...
user avatar
  • 87.1k
6 votes

Which method has better performance

This is essentially impossible to answer. You have one part of your question, wrong Your first method uses a single node_load_multiple() with multiple node_save Your second answer uses multiple ...
user avatar
  • 37.6k
6 votes
Accepted

Is it helpful to improve performance by mysql table indexing?

The cache_default table already has an index by CID (as well as indexes by creation and expiry date that allow old entries to be discarded). Since almost all queries to the table are by CID there's ...
user avatar
5 votes

Delete all users and there content apart from user 1

You can use Views Bulk Operations (VBO) module... Above module allows to execute bulk operations on nodes, users, comments; it also permits to apply the selected operation to all the nodes, users, or ...
user avatar
  • 12.2k

Only top scored, non community-wiki answers of a minimum length are eligible