First of all, Thanks for your great Book.
in the page 333 of First release of the Book, there is a sample of page chaching.
since this sample will cache all of the page content including all menus, it generate an small bug in real world.
- John login to site and see a project. this page is cached too!
- Guest user come to site and see a project. the Application shows him a cached page. so Guest user will see in the top menu bar: Logout(John)
you know about my mean. and it's one of my problems in a real app.
I should cache just an Action and just the output of views related to the action without including Layout and so on.
but I don't know what's the best solution!
I think it's possible to resolve the problem using the method below. although it's not a normal solution.
1- render the view from action, without sending Data to it.
Put the block of fragment caching in the first and last lines of view code.
also all data should be retrieved from DB in the view file! (move them from action to the view file)
in this case, both data from DB and also rendered HTMLs are cached.
Page 1 of 1
The Page Caching Sample In The Last Chapter Needs More Comments page 333 in the first release of the Book
Share this topic:
Page 1 of 1