如何在我的网络应用程序中配置过滤器

问题描述 投票:1回答:1

我有一个服务器,它服务于index.html和bundle.js文件(服务器:JBoss-EAP / 7,X-Powered-By:Undertow / 1)。我希望关闭我的开发环境的bundle.js文件的缓存,以便我可以更新它而无需清除缓存。

我知道我通过在我的web.xml文件中添加一个过滤器来做到这一点,但我不知道我应该使用什么样的tilter-class。我怎样才能了解更多?

wildfly undertow
1个回答
0
投票

我认为在这种情况下你不需要配置过滤器。缓冲区缓存用于缓存JBoss EAP下级子系统中的静态资源。缓冲区缓存的默认大小为10MB。

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
  <buffer-cache name="default"/>
  ....
</subsystem>

我认为你可以使用它并将缓存缓冲区大小更改为零,或者删除缓冲区缓存,即使我还没有验证。

/subsystem=undertow/buffer-cache=default/:write-attribute(name=buffer-size,value=0)
:reload

您可以参考以下文档中的详细信息:

  1. https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/configuration_guide/configuring_the_web_server_undertow#undertow-configure-buffer-caches
  2. https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/configuration_guide/reference_material#undertow-attribute-refs

请注意,您还可以在清除浏览器缓存时引用this

© www.soinside.com 2019 - 2024. All rights reserved.