gpt4 book ai didi

caching - 如何缓存常用图片?

转载 作者:行者123 更新时间:2023-12-02 15:18:34 24 4
gpt4 key购买 nike

我使用的是Grails的旧版本。 grails版本是2.2.0。我在当前应用程序设置中遇到的一个问题是,日志中充斥着来自索引页面的图像获取请求。如果我单击刷新,则重新请求所有图像。图像的日志记录如下所示

27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/f6dfNSxvksQkrB83_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/I7w4dlwL1ejngl24_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/eZhBkSt2BQK9fHES_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/Wa7tHggCCmf95GH7_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/3rCuZaRedGvhJGx9_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/23i2HLxd1XbA0Bvd_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/lbsBuqo1Imny2Ggl_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/xtTZU9vrIHzct8sN_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/rbUZx7D59tP67pfs_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/7s47yiB3BmAnzMNX_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/4TvirWFiuhdpWz7I_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:20 -0600] "GET /uploads/logos/thumbnails/oSBR4E5jH2m8iFiZ_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:21 -0600] "GET /uploads/logos/thumbnails/UGAVMxFQsotu2XNK_thumb.jpg HTTP/1.1" 404 1599
27.34.20.149 - - [03/Jul/2017:22:50:21 -0600] "GET

这些是应用程序索引页面中的图像,并且这些图像不会经常更改。我想知道一种手动解决方案来缓存这些图像,以便在每次刷新页面时都不会从应用程序中重新请求所有这些图像。感谢您的帮助!谢谢!

最佳答案

缓存资源插件非常适合Grails 2(首先提到Mike W!)。

如果您打算在将来的任何时候升级到2.4或3,则最好查看一下 Assets 管道:http://www.asset-pipeline.com/manual/#grails2http://plugins.grails.org/plugin/grails/asset-pipeline,但这可能会更好。

但是,请注意,日志中包括的所有行均为404,并且每个URL均不同。在许多环境中,错误页面将不会被缓存(这当然取决于您的设置,但是避免误报是很常见的),并且只要您每次(通过URL)不请求缓存就请求不同的资源帮助!

关于caching - 如何缓存常用图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44897400/

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