Reminder: Since you are delivering different HTTP responses according to a UA supplied header field, you must add the appropriate Vary header to your HTTP response.
Comment on Re^3: Combining a web application and a REST application under a single URI?