gpt4 book ai didi

caching - 如何在 Wildfly 10 中缓存字体(.woff、woff2、.ttf、.eot)?

转载 作者:行者123 更新时间:2023-12-05 07:49:41 24 4
gpt4 key购买 nike

我的 JSF 2.2 项目中有包含 Primefaces 5.3 和 Omnifaces 2.3 的字体文件,需要将这些文本字体文件(如 .woff 和 .woff2)放入 wildfly 缓存中,但不幸的是我没有。

图像文件(.gif、.png)和 CSS 文件在缓存中,只有文本字体不在缓存中。

我使用了该站点的提示,但仍然无法正常工作:https://gist.github.com/remibantos/5e86829e1ba6ad64eea1

我将这些谓词放在 wildlfy 中:... path-suffix [ '.woff2'] 或 path-suffix [ '.woff2.xhtml'], 但我无法拥有缓存。

遵循 WildFly 10 用于执行缓存的代码:

standalone-full.xml

    <subsystem xmlns="urn:jboss:domain:undertow:3.0">
<server name="default-server">
<host name="default-host" alias="localhost">
<filter-ref name="custom-max-age" predicate="path-suffix['.js'] or path-suffix ['.js.xhtml'] or path-suffix ['.json'] or path-suffix ['.json.xhtml'] or path-suffix ['.html'] or path-suffix ['.css'] or path-suffix ['.css.xhtml'] or path-suffix ['.jpg'] or path-suffix ['.jpg.xhtml'] or path-suffix ['.jpeg'] or path-suffix ['.jpeg.xhtml'] or path-suffix ['.png'] or path-suffix ['.png.xhtml'] or path-suffix ['.gif'] or path-suffix ['.gif.xhtml'] or path-suffix ['.eot'] or path-suffix ['.eot.xhtml'] or path-suffix ['.ttf'] or path-suffix ['.ttf.xhtml'] or path-suffix ['.woff'] or path-suffix ['.woff.xhtml'] or path-suffix ['.woff2'] or path-suffix ['.woff2.xhtml']"/>
</host>
</server>

<filters>
<response-header name="custom-max-age" header-name="Cache-Control" header-value="max-age=64800000, public"/>
</filters>

</subsystem>

请帮我解决这个问题。

谢谢。

最佳答案

经过一番测试,我发现问题出在我没有使用ssl。如果我启用 ssl (https),​​缓存通常会发生。

然后在网站开发期间我使用 http,当我需要试验缓存时我使用 https。

我不知道为什么会这样,但至少想出了解决这个问题并继续开发的方法。

非常感谢您的所有帮助:)

关于caching - 如何在 Wildfly 10 中缓存字体(.woff、woff2、.ttf、.eot)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37062704/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com