madskristensen / WebEssentials.AspNetCore.OutputCaching

Other
52 stars 17 forks source link

Cache is lost when logging #19

Closed AliRezaBeigy closed 2 years ago

AliRezaBeigy commented 4 years ago

What is the reason for the following line? https://github.com/madskristensen/WebEssentials.AspNetCore.OutputCaching/blob/fb5baeec8e29448202514c564546c72635467004/src/OutputCacheProfile.cs#L64

This line makes caches expired, we have some log files, and whenever a log file updates, we lose the caches

madskristensen commented 4 years ago

The point is that when the file being cached changes, the cache should expire. The source of truth has changed and so the cache needs to be re-hydrated.

AliRezaBeigy commented 4 years ago

Excuse me but I didn't get it, the goal is caching the response, when I change a file in the app folder why cache expires? the response cache stored in memory, I didn't realize any relation between a file in the app folder with cache in memory, am I wrong?