We experience differences on Lucee with IIS, when Cache Control header is added to IIS web.config

Issue:

When “<add name="Cache-Control“ is added added in IIS web.config under the customHeader element it caused specific pages not to display (possibly a differences in the request packet IIS sends to Lucee).

Attempts to narrow down the cause:

I had try trial and error scenarios to determine if the problem was cause by having an invalid Cache-Control value (which I determined was not the case), the follow are the tests and their results:

Change
Restored the cause of the error

Reason
I needed to reproduce the errors for myself

Result
Errors appeared as expected

Change
Added above the <add …

Reason
Checked if removing Lucee cache control header first before adding header via web.config would discount IIS as the cause of the problem, by making the cache control value correct on every page

Result
The issue occurred here as well

Change
Added outbound rule to replace the removed <add … for cache control

Reason
Checked if IIS setting cache control could cause the same issue

Result
Issue didn’t occur

Change
Removes all settings for the cache control header from web.config and Lucee

Reason
Checked if having no cache control header at all caused the issue too.

Result
Issue didn’t occur

Change
Removed every mention of cache control cfheader from lucee and added <add … again

Reason
Checked if when the header value is set correctly the for all pages using IIS <add … the issue won’t occur

Result
Issue occurred again

The above finding tell me that only when using the <add … does the difference occur, with outboundRule for setting this header the error doesn’t occur. So, I hypothesize the <add … either causes IIS to either send a different request header value or it causes a server side difference that Coldfusion could compensate for but Lucee couldn’t.

Currently checking the request headers to determine the differences that may/not cause the error to occur, I will add some code to intercept and log the request header provided by IIS to Lucee, I will also check the IIS logs.

OS: Windows Server 2019
Java Version: Java Zulu 11
Tomcat Version: Tomcat 9
Lucee Version: 5.3.6.61
IIS: version 7

What is the full header you’re trying to add?

@Rilwan Welcome!

Additionally to what @River_Bender said: What I don’t clearly understand, you are saying you are setting custom headers, and I’m supposing you are setting them as server response headers. Why should they affect Lucee/Tomcat if all this setting does is: it adds a server response header to the generated http stream. You can add a custom header name/value pair of your choice, and it would simply add those. I can’t think of how it could affect Tomcat/Lucee execution, because these headers are added after the cfml execution, or am I missing something?

Then: Are you really sure your code in the web.config is valid and syntatically correct? I’ve seen a lot of IIS errors because of malformed config files, unsupported attributes etc). I’d try adding the values through the IIS Manager “Custom Header” section, so it will add the headers and data in a syntatically correct manner for you IIS version.

Also, you said you are using IIS 7 on Win10? By default IIS should be 10 on Win10. Not sure what tweaks you did, to get IIS 7 running on Windows 10. IIS 7 is really old. I’d port it to a newer version.

Also, did you see how the server responses look like in your browsers dev tool? How do the custom responser headers look like there? I’m pretty sure your response headers are malformed and your browser just may be breaking something because of that.

@Rilwan has given more details here: Recovering Headers and Request sent from IIS or directly from the browser