Skip to content

Feature: Support Authenticated Request Caching #113

@derrickmehaffy

Description

@derrickmehaffy

Effectively the way this would be implemented is we would check for the Authorization header of the request

Depending on how the user configures the content-type (this won't be enabled by default or when using the contentTypes array option in the strategy) would be like so:

  • If the user configures the API to cache at the user level: then we create a specific cache key for the user which includes their user ID as part of the key prefix
  • If the user configures the API to cache at the role level: then we create a specific cache key for the role which includes the role ID as part of the key prefix
  • Public requests will not use either user/role cache response
  • Authenticated requests will not use the public cache response
  • role/user cannot both be enabled, it'll be one or the other
  • You will be able to cache public and authenticated but their cache keys won't be shared

Example cache key structure: keyv:{{ custom prefix if enabled }}{{user[id] OR role[id]}}:restOfTheNormalKey

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions