Skip to content

Warn about max-age less then 10 #755

@ctrladel

Description

@ctrladel

Feature request

When troubleshooting parts of a page that don't update correctly jr developers will often end up setting max-age on blocks or render arrays, see the problem is fixed and commit max-age 0. This is often really bad since max-age 0 or a low max-age makes any page with that render array uncacheable and can have catastrophic performance impacts on a site.

Since there are very few reasons to set max-age less then 10 it would be great if phpstan could warn about this similar to how it warns about \Drupal::serivice() so that jr developer being led down the path of making their sites uncacheable are warned about the implications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions