Development

Increasing Memory for Specific Paths in Drupal 8

Most of the examples I see for Drupal 8 are for single-path memory limit increases.

The examples for Drupal 7 often follow the pattern below.

Here’s a D8 version that supports multiple paths.

Place this in your settings.php (or site/environment-specific settings.php), then update the paths accordingly.

The options are endless for how you can handle different paths. Here’s another example where we cover node/{NID}/edit  paths.

You could combine the node/add  and node/{NID}/edit  paths with the same regex pattern.

You could handle all of the urls with preg_match  if that’s your preference. strpos  is more performant, as far as I know.

Leave a Reply

Your email address will not be published. Required fields are marked *