Skip to content

Commit

Permalink
Version 0.1.302
Browse files Browse the repository at this point in the history
* Fixed exception in client.cache, close #348
  • Loading branch information
tshemsedinov committed Jul 10, 2015
1 parent 4d27a6e commit eeeb276
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
@@ -1,3 +1,8 @@
0.1.302 / 2015-07-11
==================

* Fixed exception in client.cache, close #348

0.1.301 / 2015-07-10
==================

Expand Down
7 changes: 4 additions & 3 deletions lib/impress.client.js
Expand Up @@ -576,14 +576,15 @@ Client.prototype.end = function(output, socket) {
//
Client.prototype.saveCache = function(output) {
var client = this,
application = client.application;
application = client.application,
now = new Date();

application.cache.pages[client.realPath] = {
expireTime: client.startTime + client.context.cache,
statusCode: client.res.statusCode,
contentType: client.res.getHeader('content-type'),
contentEncoding: client.res.getHeader('content-encoding'),
stats: { size: output.length, mtime: Date.now() },
stats: { size: output.length, mtime: now.getTime(), time: now.toGMTString() },
data: output
};
};
Expand All @@ -599,7 +600,7 @@ Client.prototype.sendCache = function(cache) {
if (cache.contentEncoding) client.res.setHeader('Content-Encoding', cache.contentEncoding);
if (cache.stats) {
client.res.setHeader('Content-Length', cache.stats.size);
client.res.setHeader('Last-Modified', cache.stats.mtime.toGMTString());
client.res.setHeader('Last-Modified', cache.stats.time);
}
client.end(cache.data);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "impress",
"version": "0.1.301",
"version": "0.1.302",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",
"description": "Impress Application Server for Node.js",
"license": "(MIT OR RUMI)",
Expand Down

0 comments on commit eeeb276

Please sign in to comment.