gpt4 book ai didi

optimization - 为什么 DNN 中包含的图像和 javascript 文件在我替换它们后不再缓存在客户端上?

转载 作者:行者123 更新时间:2023-12-03 15:52:53 25 4
gpt4 key购买 nike

我安装了 DotNetNuke 4.9.2 版,我正在使用 Firebug 和 YSLOW 观察准备好的缓存状态......

所有的图片和javascript都缓存在客户端,除非我替换它们......所以如果我上传一个新的LOGO图片,它就不再缓存了。现有的被缓存。如果我替换现有的 .js 文件(我通过 minifier 运行了一个),它就不再被缓存。如果我用原始文件替换新文件,它们将再次被缓存。

我找不到任何关于此的文档......有任何想法吗?谢谢!

最佳答案

我找到了这个引用:

Solving the Caching Problem

Here's where I'd love to share the brilliant debugging and problem solving skills I used to fix the problem. Only I can't, because I could never work out what was wrong. To me, it would seem that using the simple overload [setCache(key,object)] just doesn't work properly.

What I did in the end was to use the same code I used for the Url Dictionary cache. This was a different overload because it used a callback and a fixed expiration time.


这是代码:
DateTime absoluteExpiration = DateTime.Now.Add(settings.CacheTime);
DataCache.SetCache(UrlDictKey, urlDict, null, absoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.AboveNormal, onRemove, settings.CachePersistRestart);

This code uses a different overload, and for some reason, works properly. Testing confirmed it : previously, when hammering the test server with requests, eventually it would choke up as the database loaded up on queries to the same table over and over again. Now, there would be one call to the sp, the item would be cached, and the requests could go through without choking.


在以下位置找到此引用: http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/55/DotNetNuke-Caching-and-a-performance-problem/
希望我至少能够帮助您或为您指明正确的方向。

关于optimization - 为什么 DNN 中包含的图像和 javascript 文件在我替换它们后不再缓存在客户端上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/598896/

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