Benchmark logging
This commit is contained in:
@@ -50,7 +50,7 @@ class PageCache
|
||||
, headers: {
|
||||
"Content-Length": res.headers[ "Content-Length" ]
|
||||
, "Content-Type": res.headers[ "Content-Type" ]
|
||||
, "X-Cache-Expires": new Date( expires )
|
||||
, "X-Cache-Expirls": new Date( expires ).toISOString()
|
||||
}
|
||||
, statusCode: res.statusCode
|
||||
, ttl: expires
|
||||
@@ -87,18 +87,19 @@ class PageCache
|
||||
|
||||
if( url in store )
|
||||
{
|
||||
Dragonfly.Info(
|
||||
"[C] "
|
||||
+ ( req.headers[ "x-forwarded-for" ] || req.connection.remoteAddress ) + " "
|
||||
+ req.method + ": " + encodeURI( url )
|
||||
+ " - " + req.headers["user-agent"]
|
||||
, Dragonfly.Visibility.VISIBLE
|
||||
);
|
||||
|
||||
var c = store[ url ];
|
||||
res.writeHead( c.statusCode, c.headers );
|
||||
res.end( c.data );
|
||||
|
||||
Dragonfly.Info(
|
||||
"[C] "
|
||||
+ ( req.headers[ "x-forwarded-for" ] || req.connection.remoteAddress ) + " "
|
||||
+ req.method + ": " + url
|
||||
+ " - " + req.headers["user-agent"]
|
||||
+ ` in ${process.hrtime.bigint() - res._hrtime}ns`
|
||||
, Dragonfly.Visibility.VISIBLE
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user