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

标签 optimization caching dotnetnuke

我安装了 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/

相关文章:

php - 如何在不使 Apache 崩溃的情况下清除 APC 缓存?

java - 如何在基于 java 的 Web 应用程序中覆盖重复的 http 缓存 header ?

python - 如何从 .pb 文件为 opencv 中的 dnn 模块生成 .pbtxt 文件?

scalability - DotNetNuke 可扩展性

ruby-on-rails - 用于亚马逊 S3 的 AutoSmusher 优化图像?

html - Firefox 存储的用户名和密码显示在我的表单中

C++ 入门(第 5 版)和 C++14

layout - 如何更改 dot net nuke 5.5 中的布局?

css - Drupal的JS和CSS优化错误

javascript - React 类组件是否有与 UseMemo 或 UseCallback 等效的组件?