Hmm that's strange. I never tried the above code. It was an example someone gave to me. Somehow you need to find out if you're in preview mode. When you figure that out update the code and it should work.
I had a checked on the latest Umbraco 7.3.4 and there's a close button for the preview within the left panel (where you've got all the different devices option).
I've grabbed the codes amend along with the JS amend for the exit button and it works like a charm
So you have to edit both files within:
1. Umbraco\preview\index.html
2. Umbraco\js\canvasdesigner.panel.js
Have you all encounter similar things before as below.
I'm using the Umbraco Forms that are rendered into the view as a macro and I'm using my custom attribute like the one above.
I have my custom controller with the [UmbracoDonutOutputCache(CacheProfile = "Page")] set as usual.
The form is rendering fine, but the weird thing is, upon clicking on the submit button it shows the below error. When i refresh the page again it will show the "thank you" message. I've checked the form entries and it's saved.
The form submission work when i comment out the customDonutCache attribute. I've tried to debug and upon form submission it's breaking when it hit the line within UmbracoDonutOutputCacheAttibute.cs of
base.OnActionExecuting(filterContext);
Can't figure out how. Appreciate any suggestion / help on this.
Or is there a way I can exclude the page from cache when there's a form module?
Hybrid + Donut Caching Preview mode
Hi All,
I'm using Umbraco 7.2.4 and was wondering if there's any way to exclude the donut caching bit when we clicked on the "Preview" button?
The preview doesn't seems to work and it seems to be cached all the time. Is there a way around this and if anyone had came across similar issues?
Thanks
Hello,
You could make your own attribute where you exclude the preview. For example:
Than you can use it like this:
[UmbracoDonutOutputCache]
Jeroen
Ic. Instead of the normal [DonutOutputCache(CacheProfile = "Page")]
i can use the [UmbracoDonutOutputCache] in my controller?
Thanks Jeroen. I'll try it out after lunch
Yes that should work.
Jeroen
Did a quick test. my previewMode var is always true even if i'm not in preview mode. Have you come across that?
So now when i clicked on the "preview" button, it will reflect on the live version as well. which is weird
Are you sure you're still in preview? Try to logout of the backoffice to make sure.
Yup logged out and retried in chrome cognito mode too. Still the same
Hmm that's strange. I never tried the above code. It was an example someone gave to me. Somehow you need to find out if you're in preview mode. When you figure that out update the code and it should work.
Jeroen
I'll try out and update. Thanks Jeroen :)
Maybe the cookie itself is also being cached?
In any event, here is how I avoid caching pages in preview mode: https://github.com/jbreuer/Hybrid-Framework-Best-Practices/issues/2
Essentially, I change the cache key for any page being previewed.
There is another solution somebody mentioned there that I haven't tried.
Hey Jeroen, the solution that you have actually works. Thumbs up
It's because of the Preview mode cookie not being killed. Thanks to Nicholas for nothing this down.
I need to find a way to exit the preview mode (which will kill the preview cookie) as the top right hand exit banner is not showing on mine.
Kudos to both of you ;)
I had a checked on the latest Umbraco 7.3.4 and there's a close button for the preview within the left panel (where you've got all the different devices option).
I've grabbed the codes amend along with the JS amend for the exit button and it works like a charm
So you have to edit both files within:
1. Umbraco\preview\index.html
2. Umbraco\js\canvasdesigner.panel.js
Hi all,
Have you all encounter similar things before as below.
I'm using the Umbraco Forms that are rendered into the view as a macro and I'm using my custom attribute like the one above.
I have my custom controller with the [UmbracoDonutOutputCache(CacheProfile = "Page")] set as usual.
The form is rendering fine, but the weird thing is, upon clicking on the submit button it shows the below error. When i refresh the page again it will show the "thank you" message. I've checked the form entries and it's saved.
The form submission work when i comment out the customDonutCache attribute. I've tried to debug and upon form submission it's breaking when it hit the line within UmbracoDonutOutputCacheAttibute.cs of
base.OnActionExecuting(filterContext);
Can't figure out how. Appreciate any suggestion / help on this.
Or is there a way I can exclude the page from cache when there's a form module?
Thanks
Saw some post in the forum with similar issues and has been told to upgrade the MvcDonutCaching nuget.
I've upgraded mine to the RC1 version from Nuget which fixes the form post issues. Thought to share if anyone is having similar issues as well
is working on a reply...