-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Friendlier cached GET API #55
Comments
I've had good success with putting urlencoded JSON in a GET query argument. Simplest possible thing and works just right with caching. There's a size limit, but that's not really different from headers. At least for Cloudflare, limits seem pretty much equal: 16 KB for url, 16 KB for a single header. https://developers.cloudflare.com/workers/platform/limits/#request-limits |
Using just the URL for the query definitely sounds feasible in this case (when we were designing Seafowl first, we were worried about URL limits and inconsistent stories about what query length Though we just discovered in #306 that Cloudflare will not cache CORS OPTIONS preflights, which is suboptimal for Seafowl instances that are supposed to scale to zero when idle. Even if a query result is cached by Cloudflare, a brand new browser visiting the page will still trigger a CORS preflight, waking up the instance and defeating the purpose of scaling to zero. I think with using just the URL for the query we can make Seafowl requests be considered "simple" so that browsers won's send a CORS preflight altogether. |
If the GET API receives an unhashed SQL query in the URL (e.g. just urlencoded), hash it and redirect the user to the hashed endpoint), as per #20 (comment)
Need to consider the fact that the redirect will only make sense if the client ends up sending the actual query in the GET body/header correctly. So we need to use a redirect that preserves the headers/body and the client needs to send the headers/body in the original request as well, potentially limiting the friendliness of this.
The text was updated successfully, but these errors were encountered: