All Projects → johntron → superagent-no-cache

johntron / superagent-no-cache

Licence: other
Plugin for visionmedia/superagent that adds headers to all requests that prevents caching.

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to superagent-no-cache

buptclass
A nodejs-spider that gets the infomation of empty classrooms in BUPT
Stars: ✭ 29 (+16%)
Mutual labels:  superagent
superdeno
Super-agent driven library for testing Deno HTTP servers.
Stars: ✭ 119 (+376%)
Mutual labels:  superagent
Douban
Awesome douban DEMO created with Vue2.x + Vuex + Vue-router + Superagent
Stars: ✭ 2,324 (+9196%)
Mutual labels:  superagent
Supertest
The motivation with this module is to provide a high-level abstraction for testing HTTP, while still allowing you to drop down to the lower-level API provided by superagent.
Stars: ✭ 11,712 (+46748%)
Mutual labels:  superagent
douyin signature
douyin web signature
Stars: ✭ 98 (+292%)
Mutual labels:  superagent
cucumber-steps
🥒 Quick start for testing with Cucumber.js
Stars: ✭ 15 (-40%)
Mutual labels:  superagent
superagent-intercept
Add functions that will be called during end() e.g. for handling error conditions without having the same code all over the place.
Stars: ✭ 23 (-8%)
Mutual labels:  superagent
Fee-movie2.0
整合了几个常用的电影网站,获取资源更方便,更新中
Stars: ✭ 33 (+32%)
Mutual labels:  superagent
superagent-use
Global plugin support for SuperAgent
Stars: ✭ 36 (+44%)
Mutual labels:  superagent

superagent-no-cache

Plugin for visionmedia/superagent that adds headers to all requests that prevents caching

Installation

Using Component

Install with component(1):

$ component install johntron/superagent-no-cache

Using NPM / Browserify

$ npm install --save superagent-no-cache

Usage

var request = require('superagent')
var noCache = require('superagent-no-cache')

request.get('/url')
    .use(noCache)
    .end(function _requestCallback() {
        // do something
    });

IE

IE is wonky - you'll need to use the named export, withQueryStrings if you want to prevent caching in some versions (which ones?):

var request = require('superagent')
var noCache = require('superagent-no-cache')
var isIE = require('ie')
var finalNoCache = isIE ? noCache : noCache.withQueryStrings

request.get('/url')
    .use(finalNoCache)
    .end(function _requestCallback() {
        // do something
    });

Contributing

yarn && yarn test

... or ...

npm install -g mocha
make test

License

The MIT License (MIT)

Copyright (c) 2015 John Syrinek

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].