This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Added a new IViewCache implementation, currently not default, that checks if a view location result is stale or not. * Added an "IsStale" virtual method to ViewLocationResult which defaults to false. * Added a new FileSystemViewLocationResult that checks the last modified time and returns stale/not stale accordingly. * Few other minor changes to fit in with the changes above.
Now DisableCaches is obsolete (and will throw an error), added two new properties to StaticConfiguration.Caching to enable and disable runtime view discovery and runtime view updating.
Now if runtime discovery is disabled we bypass the locking completely - if there's no runtime discovery then our cache can't change.
Spark uses its own caching/filesystem abstraction which doesn't play nicely with anything else, so currently it just grabs all the discovered views on startup and uses those. This means that runtime view discovery is never going to be honored. Runtime view updates also seem to be broken in Spark currently, although I'm not 100% sure why as yet. Test projects still not building at this point.
Runtime view discovery now seems to work ok. Runtime view updating still broken though - seems to be a Spark problem - I can see the updated view being sent to Spark from NancyViewFolder.UpdateContents, and I can see the lats modified time getting sent as changed, but Spark completely ignores the new content and just serves the stale one.
@@ -5,34 +5,17 @@ | |||
|
|||
public class ViewEngineStartupContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that this type is missing XML comments completely. I know it was not added in this PR, but if you have the energy to slap some on there then that would be cool, if not then we'll cover it in a ninjah commit later
All it was doing was passing in the extensions to the view engine. And it got those extensions from that same view engine object. Seemed kinda pointless :)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated view and view location caching.
Removed the following:
Added the following:
Both these settings are set to true for Debug, and false for Release, although both can be set in the bootstrapper, or toggled from diagnostics. They are both disabled in release as we can assume our caches are immutable if they're off, which means we have no locks so faster performance (although the hit isn't massive). With the diagnostics toggling its easy to switch one or both on, update the files, then switch them back off again.
View updates currently not working with Spark because it seems to do its own caching and I couldn't figure out any way to fix it.