-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a default controller to show how to set response caching header…
…s for page rendering
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.ViewEngines; | ||
using Microsoft.Extensions.Logging; | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Cms.Core.Web; | ||
using Umbraco.Cms.Web.Common.Controllers; | ||
|
||
namespace Umbraco.Docs.Samples.Web.Controllers | ||
{ | ||
public class DefaultController : RenderController | ||
{ | ||
public DefaultController(ILogger<RenderController> logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) : base(logger, compositeViewEngine, umbracoContextAccessor) | ||
{ | ||
} | ||
|
||
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] | ||
public override IActionResult Index() | ||
{ | ||
return CurrentTemplate(new ContentModel(CurrentPage)); | ||
} | ||
|
||
} | ||
} |
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