Client-side Cloud Function caching

Hi all - We are working on improving the client-side caching of some of our Cloud Functions. We want to be able to rely on client-side http-level caching to accomplish this, but after some searching, it seems like it would have to involve a custom endpoint that internally calls the function (ref: Http response headers in cloud function response - #2 by davimacedo).

My questions are:

  • Does Parse allow clients to call Cloud Functions via http GET? And/or can Cloud Functions set their own response headers?
  • Taking a step back, is there a Parse-recommended way to handle the client-side caching of Cloud Function responses?

Thank you!

For calling cloud code functions via http GET, you can create a custom endpoint in your Express.js app that triggers the cloud function and set the headers, if necessary. It shouldn’t be hard to be done.

In terms of client-side caching for cloud functions, the easiest way I can imagine is by creating a dictionary in which the key could be a hash of an object such as { functionName, params } and the value could be the result.