Drupal

How Drupal caches work under the hood

The journey of the http request in Drupal:

STEP 1. Page Cache module.

HTTP request will hit the Page Cache (page_cache) module to check if the path is in cache. 

How this is computed is via Drupal cache tags only, ignoring cache contexts and cache max-age.  For more information about cache tags, contexts, max-age (https://www.drupal.org/docs/8/api/cache-api/cache-api).

Drupal base field -- what is it and when do you need to create one?

What is a Drupal base field?

Base fields are fields that are available to all nodes like title, uid or date created.  Base fields are not limited to nodes, but to any entity like user, paragraphs, menu, blocks, block_content, etc.

It is automatically available to all existing nodes and for the ones that will be created in the future.

What could be some use case for creating a base field?

5 key items that maketh a dangerous Drupal backend developer (in a good way)

man analysing

These are the 5 keys concepts that would make you a very dangerous Drupal backend developer -- in a good way!    

1. Almost everything is a plugin, service, or a class that can be created or replaced.

We can replace all plugins, services, or certain class implementations.  This is usually done via hooks and event subscribers.

Drupal private file mystery -- who has access?

What is the default drupal private file/image field behavior?  It is a mystery.  Is it only for authenticated users?  Will it ever be visible publicly?

For more context, we are talking about files found in system/files/*.

Here is the short summary (TLDR):

If you have access to view the content, then you can view the private files attached to it.

Some scenarios: