| Author |
Message |
Guest
|
Posted:
Tue Oct 18, 2005 4:51 pm Post subject:
Output caching in code-behind with VaryByCustom=CMSPosting |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
 |
|
|
|
|