koa-static-cache
Advanced tools
Comparing version 3.0.3 to 3.1.0
3.1.0 / 2015-03-28 | ||
================== | ||
* Merge pull request #33 from AlexeyKhristov/gz | ||
3.0.3 / 2015-03-28 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -115,3 +115,9 @@ var crypto = require('crypto') | ||
if (shouldGzip) { | ||
file.zipBuffer = yield gzip(file.buffer) | ||
var gzFile = files[filename + '.gz']; | ||
if (options.usePrecompiledGzip && gzFile && gzFile.buffer) { // if .gz file already read from disk | ||
file.zipBuffer = gzFile.buffer | ||
} else { | ||
file.zipBuffer = yield gzip(file.buffer) | ||
} | ||
this.set('Content-Encoding', 'gzip') | ||
@@ -118,0 +124,0 @@ this.body = file.zipBuffer |
{ | ||
"name": "koa-static-cache", | ||
"description": "Static cache for koa", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
@@ -25,2 +25,3 @@ # Koa Static Cache | ||
- Uses MD5 hash sum as an ETag. | ||
- Uses .gz files if present on disk, like nginx gzip_static module | ||
@@ -52,2 +53,3 @@ ## Installation | ||
- `options.gzip` (bool) - when request's accept-encoding include gzip, files will compressed by gzip. | ||
- `options.usePrecompiledGzip` (bool) - try use gzip files, loaded from disk, like nginx gzip_static | ||
- `options.alias` (obj) - object map of aliases. See below. | ||
@@ -54,0 +56,0 @@ - `options.prefix` (str) - the url prefix you wish to add, default to `''`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13476
167
137