Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: A Cookie Problem - Using Composite.Web.Request.CookieValue with functions displays someone else's data

$
0
0
You are probably experiencing the effects of "ASP.NET full page caching". By default - if you do not opt out - Composite C1 pages will be cached. This dramatically improve performance on sites with heavy traffic.

If you have a functionality which outputs "private data" you can make that particular page stop caching by adding the block below to yout XSLT output - this will be picked up by the render core and invoke the C1 Function Composite.Web.Response.SetServerPageCacheDuration - which will instruct ASP.NET to disable full page caching for the request.
<f:function name="Composite.Web.Response.SetServerPageCacheDuration" xmlns:f="http://www.composite.net/ns/function/1.0">
  <f:param name="MaxSeconds" value="0" />
</f:function>
You can globally turn off caching by editing /web.config and change 60 to 0 in this block:
<outputCacheProfiles>
          <add name="C1Page" duration="60" varyByCustom="C1Page" varyByParam="*" />
        </outputCacheProfiles> 
Note that full page caching is always turned off for users that are logged into the C1 Console - this ensure that you always see fresh data when you browse your site as an admin, but it also prevents you from seeing cache issues like this while logged in.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>