Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Add a mechanism for caching queries #74

Open
nickpalmer opened this issue Oct 19, 2017 · 4 comments
Open

Add a mechanism for caching queries #74

nickpalmer opened this issue Oct 19, 2017 · 4 comments

Comments

@nickpalmer
Copy link
Contributor

In a SPA if I navigate back Kasia shouldn't have to re-run the queries to build the page.

@nickpalmer
Copy link
Contributor Author

This probably needs some way to specify a 'cache-key' and an expiration time as a portion of the API. Maybe an optional third function to the connect calls that returns those values?

@sdgluck
Copy link
Contributor

sdgluck commented Nov 5, 2017

It might be possible by creating an "intercept transport" for the node-wpapi library that does something like hashing the final request URL and storing that as the cache-key. Before each request is fired, we check if the hash is different. Something like that?

@MickeyKay
Copy link

MickeyKay commented Jan 10, 2018

We have a similar need, and are likely going to try to integrate node-redis into that transport method. I believe this is the prescribed approach. Here's an example for reference: https://github.com/WP-API/node-wpapi#customizing-http-request-behavior

@MickeyKay
Copy link

Somewhat related: #77

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants