I need to interface with a 3rd party API. With this API I make a GET request from within the end user's browser and receive an XML response. This data is to be used in a browser based application where the user can search through it, use it to make decisions, etc. The main issue is that most browsers have locked down cross-domain XML use, so I can't simply get the XML from the API.
The overall data, though, is basically broken into two sets.
- The first set of data is public and only needs to be updated every so often, so it can be cached for all users on the server side, lightening the traffic considerably.
- The second set of data is private and individual to each user. This data is also updated in the API more frequently. This leads caching to be much less effective.
For scalability reasons I would like to keep the server's load a small as possible.
I see two options before me:
- Provide a proxy that can be used to route XML requests to the 3rd party server and directly back and forth between client and 3rd party API.
- Have the server do the conversion from XML to JSON and strip out unnecessary information. This essentially means making a new API for our server, which translates into requests from the 3rd party API
What would be the best way to provide the data to the user? (Does not have to be one of the two options)