Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
REST responses for creating entities with POST add a $response->addCacheableDependency($url);
call. But that responses should not be cached at all.
Proposed resolution
Remove that $response->addCacheableDependency($url);
call.
Remaining tasks
Write & review patch.
User interface changes
none
API changes
none
Data model changes
none
Comment | File | Size | Author |
---|---|---|---|
#2 | rest-post-cache-2571929-2.patch | 843 bytes | klausi |
Comments
Comment #2
klausiPatch attached.
The response is already uncachable, so that call is just completely wrong and does not do anything. Url does not implement CacheableDependencyInterface, so it has no effect.
Comment #4
Wim LeersComment #5
alexpottLooks possible to test.
Comment #6
alexpottalso sounds like a bug
Comment #7
Wim LeersThis is what the actual "problem" is. There is no actual bug.
Comment #8
Wim LeersTherefore moving back to RTBC. Let's hear what committers think.
Comment #9
alexpottCommitted 6b0d523 and pushed to 8.0.x and 8.1.x. Thanks!
I had to manually apply the patch to 8.1.x because the patch would not apply - also I fixed a spelling mistake...
cachability
should becacheability
Comment #12
Wim LeersThanks Alex, and good catch :)