How to detect if cached composition data is obsolete?
See original GitHub issueLet’s say my main assembly has version 1.0.1.0
. I serialize its composition data to disk:
await cacheManager.SaveAsync(configuration, stream);
Then I update my assembly version to 1.0.2.0
. Finally, I successfully (and a bit unexpectedly) deserialize the composition data from the previously saved cache:
var epf = await cacheManager.LoadExportProviderFactoryAsync(stream, resolver);
I expected this to fail, since the version has changed. Viewing the serialized data, I can see the old version number lurking around. Running the application seems to work, but I guess there could have been a problem if the dependencies had changed.
Not sure how to interpret these findings. What is the expected behavior, and why?
More importantly, is it possible to detect if a serialized cache is obsolete?
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
How to inform remote users a cached data is out of date?
First thing to do is to include the expiration / valid till date along with the data response. Second thing to do is...
Read more >cache - Can we programatically verify the Lightning ...
As I see it, that inconsistency is due to data being pulled from Cache, but not server side. And it seems, I need...
Read more >Data fetching and caching with SWR and Vue.js
Stale means that the data in the cache is outdated. Revalidate means to get a fresh copy of the data from the remote...
Read more >Optimize Data For Your Use Cases Using Hot Cache
This article is going to cover caching architecture patterns, that may help to prevent performance issues. Wikipedia states that "cache is a hardware...
Read more >Memory and storage in After Effects
This is helpful when trying to determine which layers are cached in a composition. Enable the Layer Cache Indicators option by pressing Ctrl...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. I decided to serialize the scanned assembly timestamps together with the graph data. If the timestamps differs, the cache is invalidated.
I agree. But the cache should be built on every build, so if the developer adds an Export, on the very next test run or debug launch they’ll be running with the new cache.