City-of-Bloomington / drupal-module-onboard

Drupal module for integration with OnBoard
GNU General Public License v2.0
0 stars 1 forks source link

Create cache max-age configuration for module #14

Open inghamn opened 6 years ago

inghamn commented 6 years ago

Because the cache control for the module's blocks is not explicit, unexpected things are happening.

The module's blocks need to explicitly declare cache contexts and max-age (at a minimum). The context can probably just be "url.path". However, we want to try to match the cron job that's clearing the drupal cache.

The onboard module should declare a new configuration setting, called "Cache Max Age". This value would be in seconds, and used in the blocks to declare how long drupal should cache the blocks' renderings.

https://www.drupal.org/docs/8/api/render-api/cacheability-of-render-arrays