Skip to content

Commit c9bdbcb

Browse files
authored
Merge pull request #14 from paulwalker/remove-debug-route
Remove debug route
2 parents 390fcfc + 6d4e542 commit c9bdbcb

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ when to load the urlCache and assetCache
145145
the 'startup' value is necessary in a multiple server environment as it is possible for a fingerprinted request to come into a particular server before it has generated a fingerprinted URL for that asset itself.
146146
(i may work a way around this in the future, not too hard to reverse engineer the asset from the fingerprinted url)
147147
148-
### debug
149-
create a GET /expiry route that outputs the json of the urlCache and assetCache
150-
151-
```js
152-
debug: process.env.NODE_ENV === 'development'
153-
}));
154-
```
155-
156148
## Enabled vs Disabled (!development vs development)
157149
If both conditional and unconditional have a value of none (the default in development), static-expiry is disabled and the `furl` function will not fingerprint the url.
158150

index.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ var crypto = require('crypto')
2929
location: 'prefile',
3030
loadCache: isDev ? 'furl' : 'startup',
3131
host: null,
32-
useSecond: !isDev,
33-
debug: isDev
32+
useSecond: !isDev
3433
};
3534

3635
exports = module.exports = expiry;
@@ -131,19 +130,7 @@ function preCache() {
131130
};
132131

133132
/**
134-
* Renders the urlCache and assetCache values
135-
*
136-
* @api private
137-
*/
138-
function expiryGet(req, res) {
139-
var json = { urlCache: expiry.urlCache, assetCache: expiry.assetCache }
140-
, body = JSON.stringify(json, undefined, 2);
141-
res.set('Content-Type', 'text/plain');
142-
res.send(body);
143-
};
144-
145-
/**
146-
* Return and stores fingerprinted Asset URL in lookup hash.
133+
* Return and stores fingerprinted Asset URL in lookup hash.
147134
* Also stores Asset Cache Header data and Asset URL in lookup hash for use by middleware
148135
*
149136
* @api private
@@ -306,9 +293,6 @@ function expiry(app, options) {
306293
preCache();
307294
}
308295

309-
if (options.debug)
310-
app.get('/expiry', expiryGet);
311-
312296
if(!app.locals)
313297
app.locals = {};
314298

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "static-expiry",
3-
"version": "0.0.11",
3+
"version": "1.0.0",
44
"description": "Connect middleware for static files that sets caching response headers as well as generates and rewrites fingerprinted urls.",
55
"keywords": ["nodejs", "connect", "middleware", "static", "caching", "http", "fingerprint", "fingerprinting", "urls"],
66
"license": "MIT",

0 commit comments

Comments
 (0)