@SteveALee @smashingmag Yerp!
So fatigued by this.

@DaraghOShea @cloudinary Yes indeed. Using placeholders rather than a wildcard delivers that.
I'm now passing through a height in the path:
https://petsof.netlify.com/cloudinaried/500/polly.jpg
(from = "/cloudinaried/:height/:image")
Docs:
https://url.netlify.com/rk2y1QZ9w
Code: https://github.com/netlify/petsofnetlify/blob/master/netlify.toml#L8-L14
I'm now passing through a height in the path:
https://petsof.netlify.com/cloudinaried/500/polly.jpg
(from = "/cloudinaried/:height/:image")
Docs:
https://url.netlify.com/rk2y1QZ9w
Code: https://github.com/netlify/petsofnetlify/blob/master/netlify.toml#L8-L14

@mesetatron @kvncnls @Netlify That was an admission of my naiveté about the attention Jamstack had been starting to pick up.
Oopsie!
Oopsie!

@kvncnls @Netlify ha!
Not the creator. But I somewhat put the cat amongst the pigeons with this discussion:
https://github.com/jamstack/jamstack.org/issues/279
Not the creator. But I somewhat put the cat amongst the pigeons with this discussion:
https://github.com/jamstack/jamstack.org/issues/279

@Accudio @cloudinary @Netlify You're right that it's not a zero impact change to serving the same assets from your own site. But once Cloudinary ingests & caches these assets on the first request, no user would ever spot a perf impact.
They also do smart things for you, like serving the best format per client
They also do smart things for you, like serving the best format per client

@Accudio @cloudinary @Netlify Redirects happen at the edge of the Netlify CDN in some highly optimized C so that bit is crazy fast. Your browser doesn't need to look up another domain, so no additional overhead there. And @cloudinary is its own image CDN optimized for caching and serving these assets.

@davatron5000 @DavidDarnes @chriscoyier @cloudinary @Netlify @eleven_ty Aha! Well in that case, yeah that looks like an option!

@davatron5000 @DavidDarnes @chriscoyier @cloudinary @Netlify @eleven_ty I’ll dig out an example if generating _redirects file with @eleven_ty.

@davatron5000 @DavidDarnes @chriscoyier @cloudinary @Netlify @eleven_ty The images always reside in the images folder, even when served from Cloudinary. (Because Cloudinary accesses them to ingest them as the source image). There is never a “cloudinaried” folder for images. That’s just a path which resolves to the url on cloudinary.

@DavidDarnes @chriscoyier @cloudinary @Netlify ...or indeed, @eleven_ty could generate the _redirects file. (Relating this back to @chriscoyier's example )

@DavidDarnes @chriscoyier @cloudinary @Netlify Oooh that's a thought! A build plugin (or just a build script which performed logic based on the CONTEXT environment variable) could generate a couple of lines of _redirect config to do this quite nicely!
https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
https://docs.netlify.com/configure-builds/environment-variables/#build-metadata

@chriscoyier @cloudinary @Netlify Not yet. I personally do similar things to you in using my template logic and an env var to give the right path.
But with if redirects could be per build context in netlify.toml, you could leave the HTML the same and toggle one line in your redirect.
Voting for that feature!
But with if redirects could be per build context in netlify.toml, you could leave the HTML the same and toggle one line in your redirect.
Voting for that feature!

@sunnysinghio @cloudinary Luckily you can give @cloudinary a list of domains which are approved asset sources, so you can safeguard against that.
To test, try specifying a resource from another domain in this:
https://res.cloudinary.com/philhawksworth/image/fetch/q_auto,f_auto,h_200/https://petsof.netlify.app/images/angel.jpg
To test, try specifying a resource from another domain in this:
https://res.cloudinary.com/philhawksworth/image/fetch/q_auto,f_auto,h_200/https://petsof.netlify.app/images/angel.jpg

@chriscoyier @mraerino @cloudinary @Netlify True. The bit I left out for the sake of brevity, is that I also have a custom 404 rule which defaults to the original image url if Cloudinary can't find it.
Working locally with Netlify dev should make this all hum along nicely.
https://github.com/netlify/petsofnetlify/blob/master/netlify.toml#L18-L22
Working locally with Netlify dev should make this all hum along nicely.
https://github.com/netlify/petsofnetlify/blob/master/netlify.toml#L18-L22

With this, I can replace "images" with "cloudinaried" in the URL of any image on my site to serve an optimized version directly form @cloudinary's CDN.
I'l be using this a lot!
First stop: https://github.com/netlify/petsofnetlify
I'l be using this a lot!
First stop: https://github.com/netlify/petsofnetlify

Phil Hawksworth
@philhawksworth •
A nice trick to optimize your site's images without a build process or any library or framework cruft.
1. Upload & serve from @cloudinary in one step thanks to their Fetched URL API
2. Make it portable and simple with a @netlify CDN proxy
URLs FTW!
📚 https://url.netlify.com/r1g4F-x9D
1. Upload & serve from @cloudinary in one step thanks to their Fetched URL API
2. Make it portable and simple with a @netlify CDN proxy
URLs FTW!
📚 https://url.netlify.com/r1g4F-x9D

Phil Hawksworth
@philhawksworth •
I cannot recommend working with @a_alfredo highly enough!
👀 https://twitter.com/a_alfredo/status/1328301257547714565
👀 https://twitter.com/a_alfredo/status/1328301257547714565

Phil Hawksworth
@philhawksworth •
I WON CELEBRITY MASTERCHEF! https://twitter.com/philhawksworth/status/1328296440137965569

Phil Hawksworth
@philhawksworth •
I WON THE NBA FINALS https://twitter.com/realDonaldTrump/status/1328200072987893762

@jlengstorf @SalientKnight @cassidoo @levlinds FWIW this is the exact usecase I had in this example which is framework agnostic. 404s are handled by a servlerless function which attempts to render content on demand.
https://css-tricks.com/static-first-pre-generated-jamstack-sites-with-serverless-rendering-as-a-fallback/
https://css-tricks.com/static-first-pre-generated-jamstack-sites-with-serverless-rendering-as-a-fallback/