forked from johntron/superagent-no-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cb6e0a6
Showing
6 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
components | ||
build |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
build: components index.js | ||
@component build --dev | ||
|
||
components: component.json | ||
@component install --dev | ||
|
||
clean: | ||
rm -fr build components template.js | ||
|
||
.PHONY: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
# no-cache | ||
|
||
Plugin for visionmedia/superagent that adds headers to all requests that prevents | ||
caching | ||
|
||
*Note:* Until TJ merges [my pull request](https://github.com/visionmedia/superagent/pull/293) adding plugin support, you'll have to | ||
use johntron/supermedia | ||
|
||
## Installation | ||
|
||
Install with [component(1)](http://component.io): | ||
|
||
$ component install johntron/no-cache | ||
|
||
## API | ||
|
||
var request = require('request'), | ||
no_cache = require('no-cache'); | ||
request.get('/url') | ||
.use(no_cache) | ||
.end(function () { | ||
// do something | ||
}); | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "no-cache", | ||
"repo": "johntron/no-cache", | ||
"description": "Plugin for visionmedia/superagent that adds headers to all requests that prevents caching", | ||
"version": "0.0.1", | ||
"keywords": [], | ||
"dependencies": {}, | ||
"development": {}, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"scripts": [ | ||
"index.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = function(request) { | ||
request.headers = { | ||
'X-Requested-With': 'XMLHttpRequest', | ||
'Cache-Control': 'no-cache' | ||
}; | ||
return request; | ||
} |