8000 Add caching option to client · Issue #83 · contentful/contentful.js · GitHub
[go: up one dir, main page]

Skip to content
Add caching option to client #83
@felixjung

Description

@felixjung

Hi,

From my understanding of how querying the CDA through any of the SDKs or through HTTP directly works, any request to the server will count as an API request in the monthly quota of the user account.

To mitigate the problem of repeatedly exceeding the monthly quota at the company I work for, we added a cache to our our Contentful application. This cache uses the Contentful query options as keys. If we're able to find a cached value for a query object, we use that. If not, we make a request through the Contentful client. Of course you may flush the cache at any time and you can set things like the time-to-live etc.

Would you be be interested in having an optional cache integrated right into the Contentful client? I realize that such a feature would effectively enable users to bypass an otherwise paid part of your service. At the same time it seems like a useful feature and something people shouldn't necessarily have to implement themselves.

Please let me know what you think. I'd be happy to implement this myself and send you a pull request. Should you be open to this suggestion, let's discuss features. I have some ideas based on my experience with the API.

Thanks,

Felix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0