Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed cache headers

  • Loading branch information...
commit 3e2f3ab7321de6c60e5a6f67dbc8992640c1825c 1 parent 5c4ca25
Alexandru Bularca authored

Showing 2 changed files with 7 additions and 11 deletions. Show diff stats Hide diff stats

  1. +3 5 lib/routes/controller.js
  2. +4 6 lib/routes/view.js
8 lib/routes/controller.js
@@ -61,11 +61,9 @@ function handle(request, response) {
61 61 if(controller[method]){
62 62 setTimeout(getTimeoutCallback(request, response), config.server.timeoutForRequests * 1000);
63 63
64   - response.writeHead({
65   - 'Cache-Control': 'no-cache, must-revalidate',
66   - 'Pragma': 'no-cache',
67   - 'Expires': 'Fri, 01 Jan 2010 05:00:00 GMT'
68   - });
  64 + response.setHeader('Cache-Control', 'no-cache, must-revalidate');
  65 + response.setHeader('Pragma', 'no-cache');
  66 + response.setHeader('Expires', 'Fri, 01 Jan 2010 05:00:00 GMT');
69 67
70 68 controller[method](request, response);
71 69 } else {
10 lib/routes/view.js
@@ -37,12 +37,10 @@ function handle(request, response) {
37 37 var component = request.component;
38 38 var viewId = request.path || "index";
39 39
40   - response.writeHead({
41   - 'content-type': 'text/html; charset=UTF-8',
42   - 'Cache-Control': 'no-cache, must-revalidate',
43   - 'Pragma': 'no-cache',
44   - 'Expires': 'Fri, 01 Jan 2010 05:00:00 GMT'
45   - });
  40 + response.setHeader('content-type', 'text/html; charset=UTF-8');
  41 + response.setHeader('Cache-Control', 'no-cache, must-revalidate');
  42 + response.setHeader('Pragma', 'no-cache');
  43 + response.setHeader('Expires', 'Fri, 01 Jan 2010 05:00:00 GMT');
46 44 response.write(renderer.renderBootstrap(component, viewId, request, response));
47 45 }
48 46

0 comments on commit 3e2f3ab

Please sign in to comment.
Something went wrong with that request. Please try again.