Node caching HTTP proxy built on top of express-http-proxy. Persists requests and responses to an in-memory HAR-like data structure based on HAR1.2 . Caches JSON content-type responses by default with the ability to cache an entire site; including content-types describing images. Useful for testing front end code, mocking api, and saving the cache to a HAR file which can be used for further tests.
First of all thank you so much for this wonderful tool. It has saved me really good amount of time during development. I have been successfully using it in one project but now when I tried to use it in another project all the cached content being served seems to be in binary, something like this:
I can't figure out what the problem is. I have tried different node versions from 10.24.1 to 14.x. The requests when served first time are fine but later when they are served from cache the above is what I get. Any help would be much appreciated.
POST/PUTS that differ by the body content will seem identical and cause the proxy to playback an incorrect cache value. This will be fixed with the new file persistence scheme
It may be useful to invalidate cache with a global TTL. And possibly a TTL based on regExp to target groups of routes or a specific one. The current TTL = infinity
First of all thank you so much for writing this. I have been using it for some time now, and it saves me a ton of time in development. I have a little bit of dynamic configuration based on the environment so I used the config in js file. Is there a way to use it in typescript without require?