Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Anonymous-Access Site with Output Cache and Custom Web Part

  Asked By: Lucas    Date: Sep 24    Category: Sharepoint    Views: 2337

My site has Anonymous Access enabled and Output Cache enabled. The Anonymous
Cache Profile is Intranet (Collaboration Site). I have a custom web part on the
master page that reads the User-Agent from http header and writes a link to the
appropriate css file, depending on the client's browser.

When someone accesses the site anonymously (which is most of the time), the
output of the custom web part is cached from previous users, and the wrong css
file is written.

I would like to continue output caching on everything except the output of the
custom web part. I have tried:
1. writing a querystring with a guid at the end of the stylesheet that changes
each time the webpart is executed
<link href="/mystylesheet.css?rev=543a2c131d313b13e21f0" />
2. Set property CacheBehavior="0" in the webpart tag on the masterpage

Neither worked. Any ideas on what I can do? All help is appreciated.

Disabling output caching is not an option
Using a single css file for all browsers is not an option
Selecting the css file in client-side javascript is not desired



No Answers Found. Be the First, To Post Answer.