U4-7939 - Umbraco.Web.PublishedCache.XmlPublishedCache caching by route not working

Created by Oleksiy Ryabchun 11 Feb 2016, 06:03:10 Updated by wtct 03 Nov 2016, 12:06:09

Relates to: U4-8002

I'm working with Umbraco v6. I love it more than v7, because it has user friendly interface for developers, which works with dekstop not tablet. I have updated last v6.2.5 source codes for myself to work with new versions of third party libriaries, newtonesoft.json, miniprofiler and etc.

But I noticed that something wrong with published contents cache. It works slow and has low performance. From source code I found bug, But also, what is more important, in new sourxe codes of version 7.4.0 it still present

Please check Umbraco.Web.PublishedCache.XmlPublishedCache.GetByRoute At the end of this function line _routesCache.Store(contentId, route);

if contentId = 0, but content was found not from cache. contentId still have 0. So it mean that caching for all contents is not working. because all contents inserts by the same cache key "0"

Please change it to _routesCache.Store(content.Id, route);

Best regards Oleksiy

Comments

Stephan 11 Feb 2016, 10:57:05

Amazing. Good catch, thanks a lot!

Basically, we were not caching routes at all. The fix is trivial, the impact being that we are now caching routes = using more memory & the cache needs to be properly flushed.

PR https://github.com/umbraco/Umbraco-CMS/pull/1112

Review & test: ensure that routing of requests work on a normal site. Ensure that changing routes (publishing a document so that its url changes) clears the cache (browsing to the new url works).


Shannon Deminick 11 Feb 2016, 10:59:18

@zpqrtbnk you need to make sure all info is filled out on the issue - affected versions, due in version, ....


Shannon Deminick 11 Feb 2016, 13:15:29

test, checked tests, all is good


wtct 03 Nov 2016, 12:06:09

@Shandem Why not to relase new v6 version? I think it is very important issue and a lot of developers dont't know anything about this problem and they are still using latest 6.2.6 version.


Priority: Major

Type: Bug

State: Fixed

Assignee:

Difficulty: Very Easy

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.3.7

Due in version: 7.4.0

Sprint: Sprint 8

Story Points:

Cycle: