问题
Recently I built a Gatsby project and deployed it on AWS Amplify using the Amplify Console and connecting my Bitbucket repo. The project grew and now it has to build 37 pages with a ton of images. I am using ‘gatsby-source-custom-api’ for the data extraction which offers image processing using ‘gatsby-image’. It also offers a way to specify if the images was changed therefore if not changed it uses the .cache to get it already optimized by the ‘gatsby-image’. Now the issue I face is that the .cache folder is not available between builds in AWS Amplify. Can it be stored somewhere or is there another way to use it? Now it takes a good 13 minutes to build and the major part is from image processing.
回答1:
You can store the .cache folder by defining it as part of the buildspec: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html#yml-specification-syntax
来源:https://stackoverflow.com/questions/57025169/gatsby-cache-folder-in-aws-amplify-console