ajax - Request to external sites: client or server side? -
i'm working on site depends on site data access. there places makes sense make request client side, , others makes sense on server side.
my question is, in general, more advisable (in terms of performance, scalability, etc.) lean more towards sending/receiving requests external resources server rather client, or difference negligible?
it depends on these external resources plan them.
for example, if displaying pdf hosted externally, cannot have functionality prints pdf (i mean explicit trigger - user can make use of pdf controls if browser has one, cannot explicitly trigger print) because of cors. in such cases, makes more sense first fetch external pdf server , pass on client.
there cases fetch resources server , resource externally. in such cases, there exist scenario server not responding or server hosting external resource has gone down. parts of application work while parts not - not lead user experience. if directly use external resource, have lesser control on scenario - server on other hand able elegantly degrade better resource in case of failures.
it boils down on kind of resources plan work with. best judge since have better knowledge of plan do.
Comments
Post a Comment