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
In some cases I would like to control the caching of responses.
Proposed resolution
Add in a no cache option to the route when it is created.
Remaining tasks
- tests
- upgrade path
User interface changes
Added in new options to allow you to set a default no caching and also per resource.
API changes
Data model changes
- added no_cache to service_endpoint_resource.schema.yml
- added default_no_cache to services.schema.yml
patch to follow
Comment | File | Size | Author |
---|---|---|---|
#9 | services-resource_caching-2825594-9.patch | 7.16 KB | lorenzs |
#3 | Resource-Caching-2825594.patch | 4.98 KB | Gravypower |
| |||
#2 | Resource-Caching-2825594.patch | 3.3 KB | Gravypower |
|
Comments
Comment #2
Gravypower CreditAttribution: Gravypower commentedComment #3
Gravypower CreditAttribution: Gravypower commentedForgot to save a few files
Comment #4
Gravypower CreditAttribution: Gravypower commentedComment #5
kylebrowning CreditAttribution: kylebrowning as a volunteer and at Acquia commentedI like it!
Comment #8
kylebrowning CreditAttribution: kylebrowning as a volunteer and at Acquia commentedPretty sure this only failed because we have no tests.
Comment #9
lorenzs CreditAttribution: lorenzs at Cegeka commentedTested it manually, fixed some typo's and added the no_cache property to the ServiceResource class (only had a getter function).
Also added a unit test for this class and renamed the patch.
For me this can go into the dev branch.
Comment #11
lorenzs CreditAttribution: lorenzs at Cegeka commentedApparently the CI is having some trouble with the 'require' of drupal/services dev-4.x .. No clue..
Patch applies fine on my side (clean install).
Comment #12
kylebrowning CreditAttribution: kylebrowning as a volunteer and at Acquia commentedLooks like its passing now.
Comment #14
kylebrowning CreditAttribution: kylebrowning as a volunteer and at Acquia commented