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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gravypower created an issue. See original summary.

Gravypower’s picture

Gravypower’s picture

Forgot to save a few files

Gravypower’s picture

kylebrowning’s picture

Status: Active » Needs review

I like it!

The last submitted patch, 2: Resource-Caching-2825594.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 3: Resource-Caching-2825594.patch, failed testing.

kylebrowning’s picture

Pretty sure this only failed because we have no tests.

lorenzs’s picture

Tested 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.

Status: Needs review » Needs work

The last submitted patch, 9: services-resource_caching-2825594-9.patch, failed testing.

lorenzs’s picture

Status: Needs work » Needs review

Apparently 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).

kylebrowning’s picture

Status: Needs review » Reviewed & tested by the community

Looks like its passing now.

kylebrowning’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.