4

I'm trying to get IIS to act as caching reverse proxy, but the cache hit is always 0%. And I really cannot tell why. And the docs always talk of a server farm setup, which is clearly not what I want.

I set up two sites, one with a binding to 127.0.0.1:80 (the web application) and one with a binding to *:443 (the reverse proxy). Now I have configured the RP site to forward requests with the URL Rewrite Module. That works.

Then I configured the Application Request Routing Cache on the IIS Server (why can this not be configured on a specific site???). The statistics sees the requests and counts them, but the cache hit rate remains 0%. What am I doing wrong?

2
  • 1
    BTW, the application does set Cache-Control: max-age correctly. Commented Feb 12, 2014 at 11:25
  • I am trying to do the same, but cannot get things to work. Can you please post your (sanitized) rewrite rules? I have the following rule (which does not work): <rewrite> <rules> <rule name="https to http"> <match url="mypublicsite.com" /> <action type="Rewrite" url="myinternalsite" /> </rule> </rules> </rewrite> Commented Jan 19, 2016 at 11:18

2 Answers 2

3

After some months since I asked this question, I should probably write an answer myself... We've been working with the setup as described in the question, and it actually works as expected. The only problem is, that the cache hit statistics just show some arbitrary information. I haven't been able to find out what it tries to show, but in my experience, it is very useless and even misleading.

Having that said, we managed to verify that the caching works by using performance counters for both the reverse proxy site and the application site. This showed that some requests are not forwarded to the application, so it actually did cache correctly.

I hope this answer spares someone the headache with the ARR statistics page that I had...

0

I had the same issue, however my problem(s) were that:

  1. I had not setup a drive to cache on (duh! but still didnt fix it...)
  2. I had not allowed the application pool user to access the folder on disk that I had configured for caching (duh!)

Following steps 1 & 2 from here helped me fix my caching issue. https://learn.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/configure-and-enable-disk-cache-in-application-request-routing

After that, the Disk Cache Statistics in ARR were absolutely correct.

A Word of Warning

By default ARR will "Ignore Query String" and return the cached result based on the requested URL path only which in most cases (for my purposes anyway) is an epic fail. So dont forget to change that to "Include Query String" if the same applies to you

enter image description here

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.