- Issue created by @prudloff
- 🇳🇿New Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → .
AJAX responses from views are never cached by reverse-proxies like Varnish. That's because ViewAjaxResponse does not extend CacheableAjaxResponse so it has no cacheability metadata.
Now that AJAX uses GET requests ( 📌 Allow AJAX to use GET requests Fixed ) it should be possible to make ViewAjaxController return a cacheable response.
x-drupal-cache: UNCACHEABLE (no cacheability)
x-drupal-dynamic-cache: UNCACHEABLE (no cacheability)
ViewAjaxResponse should extend CacheableAjaxResponse.
And ViewAjaxController should apply the cache metadata from the view to the response.
The views_ajax_get module does this and could be used as inspiration: https://git.drupalcode.org/project/views_ajax_get/-/blob/f54e8f83db62dda...
I also see some work was started here: https://www.drupal.org/project/drupal/issues/2500313#comment-12294510 📌 Add views render caching on views ajax requests Closed: outdated
Active
11.1 🔥
views.module
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → .