brianwigfield / Meek

Meek CMS for MVC 3
MIT License
18 stars 11 forks source link

Cache error in MVC? #2

Closed timiles closed 12 years ago

timiles commented 12 years ago

I believe there is a error occurring that might be an artefact of route caching in MVC.

Using the MVC Meek.ContentSite that comes in the example, with one browser logged in as a Content Admin, and another browser not logged in at all, it is possible to have the Edit link displayed for the logged out user. Hit a request from the Content Admin user, and make another request from the logged out browser within one second. The Edit link is rendered for the logged out user.

It appears that in the MeekController.GetPartialResource child action, the call to return View(content) only triggers ContentPathProvider.GetFile at most once per second, and otherwise returns a cached view, which could have been the one with Edit links for the Content Admin.

However, I can't yet work out how to fix this, so my understanding might also be incomplete or incorrect. Any ideas?

brianwigfield commented 12 years ago

This has been fixed in the latest commit. I have also added repository level caching support.