Commit ddffd6e
HybridCache: Optimize content type change cache rebuild to resolve SQL timeouts (#21207)
* Complete the scope when no runnable job found. Without this I'm seeing timeouts and lock contention if a long-running document type save operation is running when the first distributed job is requested.
* Run serialization steps of rebuild of content cache in parallel for a small but not insignficant speed optimization.
* Add integration tests for database cache rebuild.
* Optimize rebuild of databaes and memory cache after content type update.
* Add debug log for running distributed job.
* Apply memory cache clear optimization to media.
* Optimize MediaCacheService.RebuildMemoryCacheByContentTypeAsync with lightweight query
Use GetMediaKeysByContentTypeKeys to fetch only media keys instead of loading full ContentCacheNode objects. This matches the same optimization applied to DocumentCacheService.
Also refactors Rebuild() to reuse RebuildMemoryCacheByContentTypeAsync for the memory cache clearing step.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Further updates from code review.
* Further tests for variant documents, composed documents and message pack serialization.
* Fixed failing integration tests.
* Clear the cacje level published content cache on content type change.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent e206f26 commit ddffd6e
12 files changed
Lines changed: 1993 additions & 206 deletions
File tree
- src
- Umbraco.Infrastructure
- Services/Implement
- Umbraco.PublishedCache.HybridCache
- Persistence
- Services
- tests/Umbraco.Tests.Integration
- Umbraco.Infrastructure/Services
- Umbraco.PublishedCache.HybridCache
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 94 | | |
95 | 95 | | |
0 commit comments