Discussion on storing blurhash in document versus asset in Sanity

2 replies
Last updated: Aug 26, 2024
Simple question:Is it possible to store the blurhash in the document instead of the asset ?
I know I can do something like this:

{
  "thumbnail": {
    ...thumbnail,
    "blurHash": thumbnail.asset->metadata.blurHash,
  }
}
But I think it is less efficient right ?
Aug 26, 2024, 7:58 AM
That looks like the way to go. If you use the apicdn the response will be cached, and the extra join won't be noticed.
Aug 26, 2024, 8:13 AM
Ok thank you :)
Aug 26, 2024, 8:22 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?