A resource designed to accept a request body containing complex query parameters and redirect to a new location to enable the results of complex and expensive queries to be cached.
There are practical limitations to the length of a URL on the Web. In order to send complex queries it is sometimes necessary to use a POST method and use the request body to describe the query parameters. However, a POST method cannot return a cached response. If the complex queries take a non-trivial amount of time to execute then it may be desirable to cache those results either on the client side or the server side.
In order to allow complex queries and still allow results to be cached, a
Bouncer resource can be used to accept the POST request with the complex query parameters and redirect to a query resource with a fingerprint value in the URL that can be used to retrieve the complex query parameters.
The bouncer resource is an alternative approach to trying to encode query parameters into URL friendly tokens. The cost is an additional redirect round-trip and the complexity of the server calculating fingerprints and storing/retrieving query parameters.
The bouncer resource must calculate a fingerprint of the incoming query parameters and store the parameters if they are not previously stored. It is important that two distinct requests that have the same set of query parameter values should generate the same fingerprint in order to take advantage of cached results. This means the bouncer resource may perform some normalization on the query parameters before calculating the fingerprint.
The redirect URL that contains the fingerprint should not be bookmarked by the client as the bouncer resource may choose to expire the stored parameters at anytime.