Permalink
Browse files

fixed cache headers

  • Loading branch information...
1 parent 5c4ca25 commit 3e2f3ab7321de6c60e5a6f67dbc8992640c1825c Alexandru Bularca committed Jul 23, 2012
Showing with 7 additions and 11 deletions.
  1. +3 −5 lib/routes/controller.js
  2. +4 −6 lib/routes/view.js
View
8 lib/routes/controller.js
@@ -61,11 +61,9 @@ function handle(request, response) {
if(controller[method]){
setTimeout(getTimeoutCallback(request, response), config.server.timeoutForRequests * 1000);
- response.writeHead({
- 'Cache-Control': 'no-cache, must-revalidate',
- 'Pragma': 'no-cache',
- 'Expires': 'Fri, 01 Jan 2010 05:00:00 GMT'
- });
+ response.setHeader('Cache-Control', 'no-cache, must-revalidate');
+ response.setHeader('Pragma', 'no-cache');
+ response.setHeader('Expires', 'Fri, 01 Jan 2010 05:00:00 GMT');
controller[method](request, response);
} else {
View
10 lib/routes/view.js
@@ -37,12 +37,10 @@ function handle(request, response) {
var component = request.component;
var viewId = request.path || "index";
- response.writeHead({
- 'content-type': 'text/html; charset=UTF-8',
- 'Cache-Control': 'no-cache, must-revalidate',
- 'Pragma': 'no-cache',
- 'Expires': 'Fri, 01 Jan 2010 05:00:00 GMT'
- });
+ response.setHeader('content-type', 'text/html; charset=UTF-8');
+ response.setHeader('Cache-Control', 'no-cache, must-revalidate');
+ response.setHeader('Pragma', 'no-cache');
+ response.setHeader('Expires', 'Fri, 01 Jan 2010 05:00:00 GMT');
response.write(renderer.renderBootstrap(component, viewId, request, response));
}

0 comments on commit 3e2f3ab

Please sign in to comment.