GET /webform_rest/{webform_id}/fields should use cache

Created on 23 September 2022, about 2 years ago
Updated 4 July 2024, 6 months ago

Problem/Motivation

Calling /webform_rest/{webform_id}/fields endpoint with aGET request returns a non cachable response :
Drupal\rest\ModifiedResourceResponse, hence no dynamic cache and cache metadata, the cache-control http header is also set to must-revalidate, no-cache, private.

The performances are awful, > 3s!

ModifiedResourceResponse

Steps to reproduce

Use

curl -I https://your-site/webform_rest/{webform_id}/fields <code> to check there no cache on this call.

<h3 id="summary-proposed-resolution">Proposed resolution</h3>
Return a <code>Drupal\Core\Cache\CacheableResponse

(at least for GET request, but I don't think other type of request are used here)

๐Ÿ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance O'Briat Nantes

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024