Images not working on certain parts #5852
-
I'm having issues with inconsistent image loading using Google Cloud Storage in production. I have other applications where it worked fine so I thought surely I messed something up, but once I visited https://shop.robgranito.com/ and saw that the images don't work on similar conditions as for myself, I thought I'd report it. I upload an image via the admin interface, it shows up on the admin page 100% correctly but on the front end side sometimes it shows and sometimes it throws some 400 or 404 error and fails to load. Solidus Version: To Reproduce Deploy the new storefront with Google Cloud Storage Upload images Notice that on the storefront it's not working.
Current behavior Images return 400 or 404 error when you can clearly see it's there on the bucket and the admin page loads the image perfectly 100% of the times. Expected behavior Images working on the storefront. Desktop (please complete the following information):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Are you using ActiveStorage? Solidus (by default) delegates all the image URL generation and file handling to Solidus. The most common issue that people have is that they have configured ActiveStorage such that it creates expiring URLs, rather than static public URLs. Because Solidus has fragment caching on the frontend, those expiring URLs are cached, work until they expire, then stop working. I don't know anything about Google Cloud Storage, so I can offer any specific advice about configuring that backend. I would confirm that this is the issue. If it is, you can either remove the caching or (preferably) configure the ActiveStorage provider so that it creates public URLs. |
Beta Was this translation helpful? Give feedback.
Are you using ActiveStorage? Solidus (by default) delegates all the image URL generation and file handling to Solidus. The most common issue that people have is that they have configured ActiveStorage such that it creates expiring URLs, rather than static public URLs. Because Solidus has fragment caching on the frontend, those expiring URLs are cached, work until they expire, then stop working. I don't know anything about Google Cloud Storage, so I can offer any specific advice about configuring that backend.
I would confirm that this is the issue. If it is, you can either remove the caching or (preferably) configure the ActiveStorage provider so that it creates public URLs.