hellosendpie
Explore posts from serversCDCloudflare Developers
•Created by hellosendpie on 5/28/2024 in #pages-help
OG Image Generation Help | Workers + R2
Hello Folks!
Framework: Hugo + Nodejs Scripts
I want to dynamically generate my OG images, based on whether the "og:image" url returns a 404 or not.
Ideal flow:
If it returns a 404, just send that url to a worker, where I can catch this url and accordingly update my r2 bucket with the respective picture needed for that route.
Reasoning:
- I already locally run a script that generates Og images using puppeteer, wouldn't mind pushing it to another worker friendly approach
- I don't want to pre-generate these at build time, I want to save resources and statically have the links coded into my html, but only render them in r2 when a request to the static og image link returns a 404
- I don't want to parse every single request through a worker, if the file is generated, just serve it via the cdn link I've already explicitly coded in. Aka, all og image links already prefix url route with example.com
/og/
folder for ease in lookup.
Any help will be appreciated!1 replies
How do I access my user's public IP?
I'm using a FastAPI as the backend for our app, and have migrated it from our VPS to Railway a few days ago.
I noticed that this line of code, isn't returning the client's Public IP anymore, and is instead returning IPs in the range 192.168.0.X:
How do I fix it?
Project ID: 9104e677-99c1-48c6-bbe8-41942e8c5fa2
8 replies
Require Context On Timeout.
Hey!
We have a server endpoint on python which requires 0.5 seconds to 2 minutes to execute (because we're analysing a file uploaded by the user).
I have wanted to know what the max timeout for a request on Railway is?
So we can plan to migrate those functions to lambda if we see ourselves hit that limit.
4 replies