sakura
sakura
Explore posts from servers
CDCloudflare Developers
Created by sakura on 9/29/2024 in #workers-help
CPU execution time graph
No description
5 replies
CDCloudflare Developers
Created by sakura on 9/20/2024 in #general-help
Unique transformations onerror behavior
The docs mention: https://developers.cloudflare.com/images/pricing/#images-transformed
A unique transformation is defined as a request to transform an original image with a combination of supported flags ↗, with the exception of the format flag.

...

The format flag being exempted from counting as a unique transformation...
A unique transformation is defined as a request to transform an original image with a combination of supported flags ↗, with the exception of the format flag.

...

The format flag being exempted from counting as a unique transformation...
If I understand correctly, onerror flag is supported for url transfomations, but not transformations from within a worker: https://developers.cloudflare.com/images/transform-images/transform-via-url/#onerror
At the moment, this setting only works directly with image transformations and does not support resizing with Cloudflare Workers.
At the moment, this setting only works directly with image transformations and does not support resizing with Cloudflare Workers.
Does this mean an image with the same resizing params (url, width, height, onerror=redirect etc.) called from a /cdn-cgi url and called from a worker will count as 2 unique transformations? Since the docs above explicitly mention the format flag is exempted from counting as a unique transformation, but onerror isn't mentioned.
2 replies
CDCloudflare Developers
Created by sakura on 9/5/2024 in #workers-help
Cron Exceeded CPU Limit
No description
6 replies
CDCloudflare Developers
Created by sakura on 8/12/2024 in #general-help
Image Transformation not working
I have a worker that makes fetch calls with resizing options using the following code. But the image doesn't actually get resized. The headers contain cf-cache-status: HIT but not Cf-Resized as I expected based on the docs - https://developers.cloudflare.com/images/reference/troubleshooting What am I doing wrong?
const response = await fetch(url, {
cf: {
image: {
height: 512,
width: 512,
},
},
})
const arrayBuffer = await response.arrayBuffer()
const headers = response.headers
// Log each header
for (const [key, value] of headers.entries()) {
console.log(`${key}: ${value}`)
}
const rawLargeBase64 = Buffer.from(arrayBuffer).toString("base64")
rawResizedImageSize = rawLargeBase64.length
console.log(`Raw image size for ${url}:`, rawResizedImageSize)
const response = await fetch(url, {
cf: {
image: {
height: 512,
width: 512,
},
},
})
const arrayBuffer = await response.arrayBuffer()
const headers = response.headers
// Log each header
for (const [key, value] of headers.entries()) {
console.log(`${key}: ${value}`)
}
const rawLargeBase64 = Buffer.from(arrayBuffer).toString("base64")
rawResizedImageSize = rawLargeBase64.length
console.log(`Raw image size for ${url}:`, rawResizedImageSize)
6 replies
CDCloudflare Developers
Created by sakura on 11/20/2023 in #general-help
Pricing Image Resizing Requests
No description
10 replies