JoshuaCWebDeveloper / jcscript

A collection of JavaScripts to aid in the development of JS projects
2 stars 1 forks source link

Allow grouping of identical requests to be configurable in ClientService #16

Open JoshuaCWebDeveloper opened 6 years ago

JoshuaCWebDeveloper commented 6 years ago

Currently, if a user sends two identical requests to ClientService, it will only make one request and send the same result two both promises. There are situations where the user may want to actually make two identical requests, so this behavior should be made configurable.

The easy way would be to make it a Boolean, with default set to true. However, the original intent was to be a poor man's caching mechanism (application sends two identical GET requests, just burden the server with one request since it would be likely returning the same result); it may be better to have the default functionality be to group identical GET requests, but don't group identical requests that aren't GET (i.e. POST). This would require a more complex configuration mechanism.