hash-request-cache
v0.0.4
Published
Express middleware for request caching
Downloads
1
Readme
Hash Request Cache
IMPORTANT NOTE: This library is just newly built. I'm using this in one of my projects so its a working copy. For you guys who'll find this useful, please wait till I finally get this running and documented :)
PS: Been coding for 2 years and just new with open source world... still a newb with npm and git.
Synopsis
Sending the same request could possibly modify your resources multiple times than expected. It should be handled that same requests should return the same response. Idempotency is important in building a fault-tolerant API.
How it works
Middlewares bind a lister to the request's 'data' event and hashes the whole request. In your last middleware, you should ask first if there is a previously cached request whether to continue processing the request or just return the previous response.
How to use
will do soon
API
will do soon
Test
will do soon
The MIT License (MIT)
Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.