Output caching in code-behind with VaryByCustom=CMSPosting
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Output caching in code-behind with VaryByCustom=CMSPosting

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Guest






Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Output caching in code-behind with VaryByCustom=CMSPosting Reply with quote

Hi all!

Due to some changes in the MCMS website I develop for, I moved the
output caching page directive to the code-behind file. In the page
directive the property 'VaryByCustom' could be set with the string
'CMSPosting'. This indicates that the caching is applied on a 'per
posting basis'.

Does anyone know if I could use this same string in the code-behind to
achieve this. E.g.:

Response.Cache.SetVaryByCustom("CMSPosting");

Or do I have to set something else? I could think of:

Response.Cache.SetVaryByCustom(CmsHttpContext.Current.Posting.Guid);

Thanx in advance for your help!

Cheers,

Stan.
Back to top
Guest






Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Re: Output caching in code-behind with VaryByCustom=CMSPosti Reply with quote

Hi Stefan,

Thanks for the reply and the link! But what do you mean by 'yes this
will do the job.'? Is it the first option mentioned in my e-mail
(string 'CMSPosting') or the second (Posting.Guid)?

Greetz,

Stan.
Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Re: Output caching in code-behind with VaryByCustom=CMSPosti Reply with quote

Hi Stan,

the first one.
Response.Cache.SetVaryByCustom("CMSPosting");

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<stanevers@hotmail.com> wrote in message
news:1129653097.324581.225050@g49g2000cwa.googlegroups.com...
Quote:
Hi Stefan,

Thanks for the reply and the link! But what do you mean by 'yes this
will do the job.'? Is it the first option mentioned in my e-mail
(string 'CMSPosting') or the second (Posting.Guid)?

Greetz,

Stan.
Back to top
Guest






Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Re: Output caching in code-behind with VaryByCustom=CMSPosti Reply with quote

Allrighty! Thanx for another quick reply!

Greetz,

Stan.
Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Re: Output caching in code-behind with VaryByCustom=CMSPosti Reply with quote

Hi Stan,

yes this will do the job.
Be aware of the following when implementing programmatic output caching:
http://blogs.technet.com/stefan_gossner/archive/2005/07/11/407522.aspx

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<stanevers@hotmail.com> wrote in message
news:1129647142.576926.197850@g44g2000cwa.googlegroups.com...
Quote:
Hi all!

Due to some changes in the MCMS website I develop for, I moved the
output caching page directive to the code-behind file. In the page
directive the property 'VaryByCustom' could be set with the string
'CMSPosting'. This indicates that the caching is applied on a 'per
posting basis'.

Does anyone know if I could use this same string in the code-behind to
achieve this. E.g.:

Response.Cache.SetVaryByCustom("CMSPosting");

Or do I have to set something else? I could think of:

Response.Cache.SetVaryByCustom(CmsHttpContext.Current.Posting.Guid);

Thanx in advance for your help!

Cheers,

Stan.
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB