CDN for static assets in backend apps
in progress
K
Kai Marshland
I would like to use Render's CDN for static sites to serve static assets for my non-static apps built with frameworks like Rails or Django.
This would let me turn off the option for Rails to serve static files. In a typical setup, this would be off and static assets would be served directly from the CDN and these requests would never hit the (comparatively slow) Rails app.
Log In
K
Kars Veling
Excellent feature, if this works, we would migrate our image serving code from our custom GCP stack to render.
+1 and would like to validate it on early access when available!
Y
Yaroslav Borets
in progress
S
Salman Adnan
Anurag Goel
S
Salman Adnan
Hello, when is this gonna be released :(
M
Mauro Bieg
Yeah, we would really need this for our dynamic Astro.build site, which serves static assets under urls like
/_image?href=%2F_astro%2Fhero.CCBYLVBN.jpg&w=1024&h=683&f=webp
You say we can put another CloudFlare in front of it, but then why not just use CloudFlare Pages directly? We like render so far because it's simple.
Edit: from the comments below it seems not even possible to put CloudFlare in front of it?! As soon as we get a bit more traffic, will have to switch provider then :-(
g
guesses_01vinyl
When did this move to 'Planned'? I am trying to get a feel of if this has been in the backlog for a long time, or whether to plan around it in the short to medium term.
p
pbruvoll
I would also like to add a +1 for this feature. Similar to Dexter I have deployed a Remix app (Node, express and serverside renderend React) with Cloudlfare in front. Beeing able to use the cache would be crucial to make the page faster for the user and take a lot of load off the Remix app and the backend it retrieves data from. I would really like for the cache to respect the Cache-Control headers set on all my files, includeing html, css, json, javascript and images.
Apperantly, it is not possiblet to get Cloudlfare CDN to respect Cahce-Control headers since Render's settings is overriding it.
I've talked to cloudlfare about it here: https://community.cloudflare.com/t/not-able-to-cache-static-assets-in-cloudflare-cdn/555484/4
"Render woud have to follow through with their plan to permit CDN Cache Control headers at their end."
I have also tried to use Cloudflare's Cache Rules, but have not had any luck with that.
Sadly, this currently seems like a showstopper for going forward with this app hosted on render with Cloudflare CDN in front.
But I have implemented a memorycache in node, so I'll give that a shot and see how it works out regarding speed and workload againt the backend.
h
hello
This can be achieved using Cloudflare's Cache Rules (Still in beta though) https://developers.cloudflare.com/cache/how-to/cache-rules/
You can set a rule to override Edge TTL which will cache it on your Cloudflare regardless of what settings Render is using.
p
pierrick.martinez.fm
+1 for this features
R
Richard Wilson
Oh wow, I just found our Render silently exports the $RAILS_SERVE_STATIC_FILES env var that configures production to serve these by default (unless you change it from the default rails new) so I just noticed it wasn't nginx or something doing this behind the scenes. How? A basic proxy pass nginx configuration isn't a lot to do for assets.
Load More
→