2012-07-20 44 views
0

我正在運行orbeon 3.70beta,我需要避免緩存。特別是我需要orbeon在HTTP響應返回以下屬性:Orbeon緩存標頭

Cache-Control=max-age=0 
Pragma=no-cache 
Expires=0 

我想在此properties.xml中的屬性:

<property as="xs:string" 
     name="oxf.http.page.cache-headers" 
     value="Cache-Control: max-age=0; Pragma: no-cache; Expires: 0"/> 

<property as="xs:string" 
     name="oxf.http.resource.cache-headers" 
     value="Cache-Control: max-age=0; Pragma: no-cache; Expires: 0"/> 

但我仍然得到這樣的迴應:

Cache-Control:public 
Content-Language:en-US 
Content-Length:772 
Content-Type:text/html; charset=utf-8 
Date:Fri, 20 Jul 2012 13:14:18 GMT 
Expires:Fri, 20 Jul 2012 13:14:18 GMT 
Last-Modified:Fri, 20 Jul 2012 13:00:51 GMT 
Pragma: 
Server:WebSphere Application Server/6.1 

Note: 
Also I add a filter in the web.xml and add the compiled filter but it 
seems that orbeon is overriding the cache headers in some point. 

Note2: 
I already override the cache headers on other application (using a filter) in the 
same websphere and the headers are successfully overridden. So the Websphere 
is not the problem. 

非常感謝您的幫助。

謝謝, 弗朗西斯科。

回答

0

這些屬性是爲Orbeon Forms 4.0添加的,因此它們將不適用於3.7。 (3.7.1已超過3年,而您使用的3.7.0beta版本可能更老。)最好的辦法是使用像UrlRewriteFilter這樣的servlet過濾器或像Apache這樣的前端HTTP服務器。

+0

嗨! 非常感謝您的回覆。 **我認爲過濾器不是一個選項,因爲我自己做了一個**,它沒有工作。如果我在處理之前(在chain.doFilter(...))orbeon之前放置過濾器,並覆蓋這些參數,並且如果我將它放在後面,或者已經將標頭刷新到客戶端並提示錯誤。你認爲我錯過了什麼,我可以用這種方法嗎? **我會更新到4.0 **,並希望它向下兼容我的3.7形式:)。 非常感謝! – panox 2012-07-23 13:57:02

+0

我意識到orbeon 4.0沒有property.xml而orbeon 3.7沒有。這是否會影響行爲?包含3.7到4.0定義的屬性是一個好主意?使其向後兼容。 – panox 2012-07-23 14:32:29

+0

你正在尋找的是'properties-local.xml'。請參閱[doc](http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties)。 – ebruchez 2012-07-23 15:58:17