Why are javascript images and javascript files included in DNN no longer cached on the client after replacing them?

I installed DotNetNuke version 4.9.2, and I monitor the running cache states using Firebug and YSLOW ...

All images and javascript are cached on the client, unless I replace them ... Therefore, if I upload a new LOGO image, it will no longer be cached. Existing are cached. If I replaced the existing .js file (I passed it through the minifier), it is no longer cached. If I replace the new file with the original file, they are cached again.

I could not find documentation on this ... any ideas? Thanks!

+6
optimization caching dotnetnuke
source share
7 answers

I found this link:

Solving the cache problem

Here, where I would like to share brilliant debugging and problem-solving skills that I used to fix this problem. Only I can not, because I could never understand what happened. For me, it would seem that using a simple overload [setCache (key, object)] just doesn't work as expected.

In the end, I used the same code that I used for the Url Dictionary cache. This was a different overload as it used a callback and a fixed expiration time.

Here is the code:

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 correctly. Testing confirmed this: earlier, when it clogged up the test server with queries, it would eventually choke when the database was loaded on request into the same table again and again. Now there will be one sp call, the element will be cached, and requests can go through without strangulation.

Found this link: http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/55/DotNetNuke-Caching-and-a-performance-problem/

I hope I was able to help at least or point you in the right direction.

+1
source share

FYI, this may be a little off topic, but DotNetNuke does a lot of its caching of modules into flat files in the / portalals / directory (this is the default caching setting). In the host menu, you can clear this cache and change the cache settings.

DotNetNuke 5.x is completely redesigned, so you can check it out if you are looking for high performance. The performance of the DotNetNuke.com website improved significantly when they moved from 4.9.x to 5.0.

+1
source share

I would not have thought that DNN would serve assets / static files (like images). I think they will just be served by IIS. If the url looks something like this:

 blah.com/GetImage.aspx?filename=logo.jpg 

If your URLs do not have "aspx" in them, then IIS is more of a problem.

+1
source share

Caching on the client depends on the specific set of HTTP headers that the web server sends to your browser, which you use the browser on subsequent requests for the same objects (that is, on the logo image).

When replacing a file, the web server will change the response it generates (Last-Modified / ETag HTTP headers), which will invalidate the cached copy of browsers.

+1
source share

Verify that the IIS instance is set to Enable Content Expiration. I found that this was not installed on several of my hosting sites, and caching was not done as it should. I turned it on and now my images and β€œstatic” files are cached properly.

Good luck j

+1
source share

I don't know about DotNetNuke, but for some reason you need to break / kill the cache by showing a different URL for the same file name. See how the big guys do it:

Stack Overflow: /js/question.min.js? v = 2527

Slashdot: images.slashdot.org/idlecore-tidied.css? T_2_5_0_244a

Digg: / css / 176 /global.css

bbc.co.uk:/home/ release-29-7 /style/homepage.min.css

0
source share

You looked at the cache settings in the host settings, I think?

0
source share

All Articles