Open candrews opened 12 years ago
Great idea!
It seems that ResponseTransformer.DoTransform is where the magic happens.
I believe adding
Response.Cache.SetCacheability(HttpCacheability.Private);
at ResponseTransformer.cs line 143 resolves this issue.
Actually, that change is a bit too aggressive (it prevents caching of pages that could be cached).
If any resource being requested by RR has a near futures expires header or should otherwise being ignored by RR (it's in the JavaScriptUrlsToIgnore list), then ResponseTransformer.cs line 143 is always hit, and the page is never cached. So the fix for this issue has to take into account ignored urls.
If request reduce has not "done it's thing" for a given request (in other words, not all CSS/JS has been reduced yet), it should tell ASP.NET to disable response caching. That way, non-request reduced responses will not be cached at the browser, proxy, or IIS level.
My problem right now is that I have ASP.NET output caching enabled, so the first generated response is cached. And since it's the first response, RR has not done its magic yet, and the non-RR'ed response ends up cached and served for all subsequent responses - the RR content is never used.
To do disable caching, you'd do this: