• hawksworx
  • blog
  • speaking
  • about
  • search

Notes - page 1089

  • Newest
  • Previous
  • Next
  • Oldest

The archive of what I posted on Twitter, which I now self host due to a lack of trust in Twitter and some other reasons.

I'll soon begin refelcting all my Mastodon posts here too. I'm happier self-hosting or maintaining an archive of my content on URLs that I can own.

There are tools to help you do this too. Such as this one from the makers of Eleventy.

A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 17th 2020 replying to this from @SteveALee
@SteveALee @smashingmag Yerp!
So fatigued by this.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 17th 2020 replying to this from @matt_hojo
@matt_hojo @Netlify ✨Woohoo!✨
Bring it on!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 17th 2020 replying to this from @DaraghOShea
@DaraghOShea @cloudinary 👍
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 17th 2020 replying to this from @DaraghOShea
@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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @mesetatron
@mesetatron @kvncnls @Netlify If in doubt, it was probably my fault.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @mesetatron
@mesetatron @kvncnls @Netlify That was an admission of my naiveté about the attention Jamstack had been starting to pick up.

Oopsie!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @kvncnls
@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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @philhawksworth
@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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @Accudio
@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.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @davatron5000
@davatron5000 @DavidDarnes @chriscoyier @cloudinary @Netlify @eleven_ty Aha! Well in that case, yeah that looks like an option!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @DavidDarnes
@DavidDarnes @davatron5000 @chriscoyier @cloudinary @Netlify @eleven_ty ☝️
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @davatron5000
@davatron5000 @DavidDarnes @chriscoyier @cloudinary @Netlify @eleven_ty I’ll dig out an example if generating _redirects file with @eleven_ty.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @davatron5000
@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.
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @philhawksworth
@DavidDarnes @chriscoyier @cloudinary @Netlify ...or indeed, @eleven_ty could generate the _redirects file. (Relating this back to @chriscoyier's example )
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @DavidDarnes
@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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @chriscoyier
@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!
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @sunnysinghio
@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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @philhawksworth
Hello again old friend.

https://twitter.com/philhawksworth/status/1252321499312259074
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @chriscoyier
@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
Embedded image from social media
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @philhawksworth
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
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020
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
Embedded image from social media
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020
I cannot recommend working with @a_alfredo highly enough!

👀 https://twitter.com/a_alfredo/status/1328301257547714565
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020
I WON CELEBRITY MASTERCHEF! https://twitter.com/philhawksworth/status/1328296440137965569
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020
I WON THE NBA FINALS https://twitter.com/realDonaldTrump/status/1328200072987893762
  • Permalink
  • |
  • Twitter
A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth • November 16th 2020 replying to this from @jlengstorf
@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/
  • Permalink
  • |
  • Twitter
  • Newest
  • Previous
  • Next
  • Oldest

The source code of this site is available on GitHub and is hosted and updated by Netlify automatically after each code commit

Other than where specified, the content on this site is published under a Creative Commons Attribution 3.0 licence.

Subscribe to a feed of blog posts on this site.