lasseschou
lasseschou
CDCloudflare Developers
Created by lasseschou on 8/6/2023 in #workers-help
Proxy video from Google Cloud Storage
Turned out that only files with .json, .txt and without extension are allowed. No idea if this is caused by a special header sent by Cloudflare, or what's going on. But the fix was to store the file without an extension
3 replies
CDCloudflare Developers
Created by lasseschou on 8/6/2023 in #workers-help
Proxy video from Google Cloud Storage
Just to elaborate, the URL for the Google Cloud Storage file is: https://www.googleapis.com/storage/v1/b/{bucket-name}/o/{path-to-file.webm}?alt=media With a "Bearer XXX" authentication token. When trying from PostMan, everything works fine. When trying to fetch another webm video (like this: return fetch("https://dl6.webmfiles.org/big-buck-bunny_trailer.webm"); - it works fine. But when I try the Google Storage link, the result is JSON:
{
"kind": "storage#object",
"id": "xxx",
"selfLink": "https://www.googleapis.com/storage/v1/b/xxx/video.webm",
"mediaLink": "https://www.googleapis.com/download/storage/v1/b/xxx/video.webm?generation=1691354946850085&alt=media",
"name": "xxx/video.webm",
"bucket": "bucket-name",
"generation": "1691354946850085",
"metageneration": "1",
"contentType": "video/webm",
"storageClass": "STANDARD",
"size": "2040129",
"md5Hash": "xxx==",
"crc32c": "52dNRg==",
"etag": "xxx=",
"timeCreated": "2023-08-06T20:49:06.853Z",
"updated": "2023-08-06T20:49:06.853Z",
"timeStorageClassUpdated": "2023-08-06T20:49:06.853Z"
}
{
"kind": "storage#object",
"id": "xxx",
"selfLink": "https://www.googleapis.com/storage/v1/b/xxx/video.webm",
"mediaLink": "https://www.googleapis.com/download/storage/v1/b/xxx/video.webm?generation=1691354946850085&alt=media",
"name": "xxx/video.webm",
"bucket": "bucket-name",
"generation": "1691354946850085",
"metageneration": "1",
"contentType": "video/webm",
"storageClass": "STANDARD",
"size": "2040129",
"md5Hash": "xxx==",
"crc32c": "52dNRg==",
"etag": "xxx=",
"timeCreated": "2023-08-06T20:49:06.853Z",
"updated": "2023-08-06T20:49:06.853Z",
"timeStorageClassUpdated": "2023-08-06T20:49:06.853Z"
}
Which is what you would expect if the "?alt=media" querystring wasn't added. I can't wrap my head around this, unless Cloudflare is somehow removing the querystring. But when I just request a JSON document, I get the real content of the remote file, not the metadata. So I have no idea what's going on.
3 replies
CDCloudflare Developers
Created by lasseschou on 5/15/2023 in #workers-help
Too many API requests by single worker invocation
Thanks for helping out
6 replies
CDCloudflare Developers
Created by lasseschou on 5/15/2023 in #workers-help
Too many API requests by single worker invocation
I just added some counters, and I can confirm that I'm reaching the 1000 KV gets, so this makes sense
6 replies
CDCloudflare Developers
Created by lasseschou on 5/15/2023 in #workers-help
Too many API requests by single worker invocation
The request to the worker itself is using the cron trigger in wrangler.toml. The subrequests consist of quite a few KV gets using KV bindings (maybe around 500 calls), and then there are around 20 external calls. There should be a limit of 1000 subrequests, but is this "internal" KV gets and external calls combined?
6 replies