2

I would like to have all HTTP requests made to my production environment be also automatically made against my testing environment. E.g. if anything makes a request to http://production.site.example.com/api/users/12345 then I want the same request to also be made against http://staging.site.example.com/api/users/12345 by some internal entity that sees the first request.

Is there an easy way to set this up in IIS without having to create a custom module or similar? If not, what is the best approach to take when creating such a module, so this does not cause any extra load on the production instance of my app?

Sander
  • 25,685
  • 3
  • 53
  • 85

1 Answers1

0

Not sure what specifically you're trying to achieve here but you might try with something simple such as implementing redirect in OnUnload event handler (I'm assuming you're using ASP.NET) that will redirect traffic to your test environment.

This way you get everything processed in your production environment and once that is completed you redirect request to test env. Again, not sure what specifically you're trying to do but I'd first try something simple like this using different redirects.

Dragan Radivojevic
  • 1,992
  • 2
  • 13
  • 14
  • I am hoping for something like an IIS module that just copies an incoming request and replays it towards my staging domain in the background. The idea being that if user X performs operation Y in production, he is also performing it in staging via this request-replaying channel. My product is essentially an API exposed via HTTP, so this would allow me to very nicely verify that no serious problems occur in testing environment (e.g. to see if the same queries took the same amount of time in both). – Sander Feb 02 '13 at 13:31
  • Yeah, I see what you mean. Sorry, but I'm not really experienced with IIS modules :(. Good idea for testing btw :). – Dragan Radivojevic Feb 02 '13 at 18:57