Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6651375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:00:13+00:00 2026-05-26T01:00:13+00:00

Have some strange behaviour regarding output caching in an ASP.NET 4 application on IIS

  • 0

Have some strange behaviour regarding output caching in an ASP.NET 4 application on IIS 7.5. I’ve been able to repeat the problem simply on other empty setups, I’m certain this is a bug, but unsure how to report it to Microsoft.

A site in IIS responds to more than 1 domain, the .NET application examins the hostname, and produces content accordingly. For example, it may print the name of the request URL in a blank page. Eg, http://www.first-domain.com, and http://www.second-domain.com

The web.config has the appropriate caching, urlCompression, and httpCompression all turned OFF under the system.webServer node.

The aspx page sets the cache-control header for public, with either a future date for expires, or a max-age value.

Visiting http://www.first-domain.com outputs the page that successfully writes ‘www.first-domain.com’.

However, visiting http://www.second-domain.com outputs a page that writes ‘www.first-domain.com’.

Examining the failed-request-traces, System.Web.Caching.OutputCacheModule has found the cached output (even though the .config files have turned the function off), the cache has matched even though the request URL hostname are different, and thus the second request will output the results of the first request to the different domain for as long as the max-age/expiry was set for, before the correct page for the second-domain will appear.

Either setting cache-control to private, or removing the ‘OutputCache’ module in the web.config solves the problem, while maintaining the correct cache-control headers sent to the browser, but obviously, I can’t take advantage of kernel caching when I need it.

I can’t find any MSDN documentation on how the OutputCacheModule is configured.

Has anyone else experienced this issue, how can I go about enabling kernel caching and let it take into account URL Hostname (without separating the application to different sites in IIS).

Thanks.

Update:

Adding SetSlidingExpiration has no effect, as the kernal cache still caches the output regardless of the request hostname. The only scenario now is to either disable output caching, or run a duplicate instance of the app on each domain it will run – considering the drop in server performance this would result in vs. the increase of performance gained in using output caching, we decided to disable output caching for this app.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:00:14+00:00Added an answer on May 26, 2026 at 1:00 am

    No answer has been provided after 9 months, and no solution has been found, only a workaround, perhaps this will be fixed in the next version of IIS greater than 7.5…

    —

    Adding SetSlidingExpiration has no effect, as the kernal cache still caches the output regardless of the request hostname. The only scenario now is to either disable output caching, or run a duplicate instance of the app on each domain it will run – considering the drop in server performance this would result in vs. the increase of performance gained in using output caching, we decided to disable output caching for this app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been noticing some very strange usage of O(1) in discussion of algorithms
I have a very strange problem. Under some elusive circumstances I fail to apply
I have some ASP.NET web services which all share a common helper class they
I have some C# / asp.net code I inherited which has a textbox which
I'm trying to learn python and have encountered some strange behaviour. I am experimenting
I'm hacking my way through learning Flex and have found some strange behaviour. When
I have come across some strange behaviour, and I'm assuming a bug in Firefox,
I have come across a strange behaviour in my (huge) .NET 4 project. At
I'm getting some strange behaviour with my form (using Zend Form). I have a
I have two monitors. I am seeing some strange behaviour when I access the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.