试图避免清漆缓存

时间:2015-09-04 16:24:00

标签: python caching nginx request varnish

我试图避免客户端的清漆缓存。使用nginx 1.6.1,它可以添加一个随机url参数(参见X-XHR-Current-Location),因此它不会得到" X-Cache":" HIT"。

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Custom Menu')
    .addItem('First item', 'menuItem1')
    .addSeparator()
    .addSubMenu(ui.createMenu('Sub-menu')
      .addItem('Second item', 'menuItem2'))
    .addToUi();
}

function menuItem1() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
    .alert('You clicked the first menu item!');
}

function menuItem2() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
    .alert('You clicked the second menu item!');
}

但是当我点击请求nginx / 1.8.0服务器时,URL会以某种方式进行条带化(请参阅X-XHR-Current-Location)并删除随机参数。还有" X-Cache"被触发并返回" HIT"。

Server: nginx/1.6.1
Date: Fri, 04 Sep 2015 13:13:02 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 20762
Status: 200 OK
X-XHR-Current-Location: /shop.json?1441372381.857126?1441372381.854355
X-UA-Compatible: IE=Edge,chrome=1
ETag: "de6da75aa7b7d6ce34bd736ccf991f36"
X-Request-Id: a39fc3b8d44687039a18499dd22a2c7d
X-Runtime: 0.371739
X-Rack-Cache: miss
Accept-Ranges: bytes
X-Varnish: 534989417
Age: 0
Via: 1.1 varnish
Cache-Control: private, max-age=0, must-revalidate
Pragma: no-cache
X-Cache: MISS
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Connection: close

我想这也是我有时会得到旧结果的原因。有什么方法可以避免" HIT"或者还假装是nginx / 1.8.0服务器的新URL?

提前感谢!

0 个答案:

没有答案