2017-11-27 35 views
0

jsファイルのキャッシュ有効期限を設定しようとしています。私は、応答応答ヘッダーwildfly/jboss内のjsファイルのキャッシュ制御時間の設定

Accept-Ranges:bytes 
Cache-Control:no-cache 
Content-Length:8709 
Content-Type:application/javascript 
Date:Mon, 27 Nov 2017 11:53:36 GMT 
Expires:Thu, 01 Jan 1970 00:00:00 GMT 
Last-Modified:Fri, 10 Nov 2017 16:57:13 GMT 
Pragma:no-cache 
Server:WildFly/11 
X-Powered-By:Undertow/1 

が他の方法であるか、私は場合は私に知らせてください設定されていないヘッダwildfly11.0まだ

<subsystem xmlns="urn:jboss:domain:undertow:4.0"> 
      <buffer-cache name="default"/> 
      <server name="default-server"> 
       <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/> 
       <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/> 
       <host name="default-host" alias="localhost"> 
        <location name="/" handler="welcome-content"/> 
        <filter-ref name="server-header"/> 
        <filter-ref name="x-powered-by-header"/> 
        <filter-ref name="custom-max-age" predicate="path-suffix('.js') or path-suffix ('.html') or path-suffix ('.css')"/> 
        <http-invoker security-realm="ApplicationRealm"/> 
       </host> 
      </server> 
      <servlet-container name="default"> 
       <jsp-config/> 
       <websockets/> 
      </servlet-container> 
      <handlers> 
       <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> 
      </handlers> 
      <filters> 
       <response-header name="server-header" header-name="Server" header-value="WildFly/11"/> 
       <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/> 
       <response-header name="custom-max-age" header-name="Cache-Control" header-value="max-age=400, public"/> 
      </filters> 
     </subsystem> 

が、のstandalone.xmlで構成下に使用しています何かが欠けている。

答えて

0

これを試してみてください:

<filter-ref name="custom-max-age" predicate="path-suffix['.js'] or path-suffix['.html'] or path-suffix['.css']"/> 
関連する問題