🔧 Maintenance Alert: World will be on Read-Only Mode on February 18th, 10:00 PM – 11:00 PM EST / 7:00 PM – 8:00 PM PST / 4:00 AM – 5:00 AM CET (Feb 19). Browsing available, but log-ins and submissions will be disabled.
AI OnAI Off
I have been trying to add ContentOutputCache to a block controller so that the blocks can have caching enabled. I put the attribute above the action of Index to apply it to the action so that whenever the block is used it will cache the details inside. When running the site and going to the page, I get the following error:
ContentOutputCacheAttribute should not be used on child actions.
I have tried to apply the output cache to the Alloy Demo and I also get the same error. Below is an example bit of code on what I am trying to do.
I have also added the settings into Web.Config to enable the caching as well.Â
After some more testing, I also tried it on the Page Controller. I made a property that renders the current DateTime to the view and disbled debug mode and ran the website in release mode. The caching still does not work on pages either.
Any help would be appreciated.Â