Cache max age configuration

Created on 26 August 2024, about 1 month ago

Problem/Motivation

Hi! I went through the code of this module and was wondering about the "max-age" block configuration parameter.
Is there a specific need for this parameter?

If I understand correctly, the module provides a simple placeholder element, instead of rendering the whole block as part of the request for the page containing it. So wouldn't it be ok to cache it indefinitely?

The configured "block_ajax" max-age is also used for the AjaxBlockResponse. Is there a reason why this response does not extend CacheableJsonResponse, to instead use the cache metadata provided by the block being rendered?

Proposed resolution

If it sounds ok and if I'm not missing something, I would be willing to make the adjustments to:

  • Allow for the placeholder to be cached indefinitely
  • Extend CacheableJsonResponse and make use of the cache metadata provided by the block
Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France arousseau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024