简体   繁体   中英

Output caching of API controllers in ASP.NET 5

Am I correct that in ASP.NET 5 ResponseCacheAttribute has replaced OutputCacheAttribute used in previous ASP.NET MVC releases? Can it be used to cache responses of API controllers? If not, what do Microsoft offer instead? I tried two free solution for WebAPI2 but was not impressed at all.

Yes, you will be able to use the ResponseCacheAttribute .

Because there is no difference between a Web Api Controller and an MVC Controller , you will be able to use the same attributes for both. This will apply whether it is the ResponseCacheAttribute , AuthorizeAttribute , RouteAttribute , or any others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM