Substitution Control and Cache Location
-
06-09-2019 - |
Question
If I use Substitution control in asp.net page, and also add the following directive to the page:
<%@ OutputCache Duration="7200" VaryByParam="None" Location="Any" %>
Would the location attribute be ignored, since using Substitution control on a page makes the page cacheable only on the server?
Solution
Yes, it will be ignored. Substition.Render calls, through RenderMarkup, HttpResponse.WriteSubstitution that calls HttpCachePolicy.SetCacheability(HttpCacheability.Server).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow