Giter Site home page Giter Site logo

sonyseng / json-caching-proxy Goto Github PK

View Code? Open in Web Editor NEW
43.0 2.0 9.0 4.24 MB

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.

JavaScript 100.00%
proxy proxy-server json-api cache cache-storage har middleware caching-library reverse-proxy testing

json-caching-proxy's People

Contributors

dependabot[bot] avatar dmarkowicz avatar hemangthakkar avatar qur2 avatar sonyseng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json-caching-proxy's Issues

Binary cached content

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:

��Q�&���O<K{�cS���������x�yV?���f��3C��<���s�9�6f�����b�����2eR������Tg���F������q�0��|Nbl_����5Ay �~Kxcc�

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.

Expand abilities for controlling proxy through the browser

The current release allows the user to control the proxy through the browser by:

  • Clear the entire cache
  • Pause persisting to cache
  • Pause replaying from the cache
  • Downloading the cache into a HAR json file

It may be useful to add these features in an admin page:

  • Display all the cached routes
  • Search cached routes
  • Alter cached routes
  • Remove cached routes
  • Exclude routes dynamically from being cached

Add options for TTL to invalidate cache

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

How can I use this in typescript

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.