Resolving 403 Forbidden Errors with IIS Performance and Caching Configuration

cacheforbiddenhttp-status-code-403iisiis-8.5

I have recently moved from a managed server to AWS running Windows 2012 R2 with IIS 8.5.

When I first open any website on my server or do a hard refresh, everything seems to be okay – no major concerns in the console and everything works as expected.

However, if I press F5 to reload the page, the console begins getting errors in it. The more times the page is refreshed, the more errors and almost always: 403 Forbidden. Sometimes they will go away, but often the console will have up to 10-15 of them. It's not just when I manually refresh, but when forms are submitted and the page is programmed to refresh as well.

This happens with image, css and js files. The js files are the biggest ones because this is causing errors in my webmail installation by preventing the TinyMCE from loading it's js files. This prevents the webmail's WYSIWYG editor and makes it useless.

I'm sure I'm missing something around the IIS cache; but, this isn't my area of exertise. I know there are a lot of resources on how to tweak IIS, I've read dozens of them, but I can't find a solution.

Here's a quick summary of current setup:

Setup:

  • Windows Server 2012 R2
  • IIS Version: 8.5 Sample site:
  • Testing in Chrome on Windows 10

Common Headers:

  • Keep Alive = true
  • Expire Content = false

Compression:

  • Dynamic compression = false
  • Static compression = true

Caching:

  • js = 2 days
  • css = 2 days
  • images = 30 days

Thanks!

Best Answer

Thank you @LexLi..

The suggestion to look into IIS logs got me moving again. From here, I was able to find a forum post that seemed relevant (https://forums.iis.net/t/1192952.aspx) because it showed the same error I was showing (403 502 combination).

The post was talking about IP restrictions, which made sense why it would fail when pressing F5 in succession but not after a period of time. I found the Dynamic IP Restriction setting and increased it... it seems to have fixed the problem.

Thanks again to @LexLi for the push.