Does Parse.com Cloud Code Have etag support?
Asked Answered
R

2

8

Does Parse.com support the use of etags and if-none-match for Conditional GETs? I'm working with a third party API that requires this as a must, to limit API calls to their server. Im using Cloud Code as my backend sending data to a Cordova/ionic hybrid app. Thanks

Regressive answered 3/11, 2015 at 5:3 Comment(2)
FYI you may wish to consider that Parse is shutting down in a year or so blog.parse.com/announcements/moving-onAntiscorbutic
I know but its open source now so I'll just have to host it myself at some point before thenRegressive
A
1

Yes depending on your definition of support. You have the ability to set arbitrary headers on the request which is all that is required. However, it appears that you will need to either store the values yourself somewhere in Parse, or simply use fixed values you believe to be incorrect. You can retrieve etag values from the response headers. The RFC can guide you to the correct values. Note that Cloud Code on the open sourced Parse Server appears to provide increased access to the underlying JS interpreter rather than being sandboxed so you can access other mechanisms that may be more friendly than Parse's own HTTP object.

Antiscorbutic answered 2/3, 2016 at 3:42 Comment(0)
O
0

Yes, you can specify this by setting your cache policies as described in the documentation.

You also have the option of using cloud code in parse.com. A background job can check whether the data has changed and if not can send you the desired response.

Octet answered 3/3, 2016 at 10:8 Comment(1)
It looks like you've linked to documentation for code that would run in iOS rather than code that would run as part of the cloud code which appears to be the scenario the question is asking about?Antiscorbutic

© 2022 - 2024 — McMap. All rights reserved.