0
votes

new to Gatsby here.

I've followed the Gatsby-image guide and store my photos in an images folder in my project and pull the photos via graphQL from there. It works great locally but I guess that kind of storage is not meant for actually production? As I get the 'failed to load resource error' from the public HTML and blurry images when deployed. From browsing through stack overflow and github it looks like a ton of people run in to this.

So where does everyone store their photos? Just curious for some advice, thanks!

1
You should look into storing your images in a CMS such as Contentful. Gatsby has a Contentful plugin gatsby-source-contentful that allows you to source your content using GraphQL. Images shouldn't be stored with source code because they're more content than structure, and they will bloat your repo size. Repos should be small (file size wise). - JMadelaine

1 Answers

1
votes

You have plenty of choices:

Cloud-Based solutions

Others:

  • Node framework's public folder. (Most of the time it's statically served)
  • Directly serve them from an Nginx or an Apache.

The list isn't exhaustive.

I recommend you to use Cloud storage because it's cheaper and you have 99.99% availability. It is also easier to link them with cloud services like permission ones (IAM of AWS for example).

And for your use case AppSync for GraphQl.