Working with a client that hit the 100GB storage maximum. Looking to rework product upload integration to deduplicate uploads, downsample oversize images, and minimize storage impact. However, I’m not finding many answers on how I will implement this with any sort of verifiable results. Ideally I should be able to show the client, for example, that I was able to reduce storage requirements by 40GB using an optimized publication workflow.
- Is there any endpoint I can query that will tell me how much storage is currently used?
- Is there any query which will produce a files list which are not referenced by a product? …by any other object? (good candidates for deletion)
- I’ve successfully coded and tested the workflow described here? “Manage media for products.” However, when I delete a media from a product, the staged media still exists. Is there no way to delete the staged media, and if not I hope it doesn’t count towards the quota. Is there any further information on the media lifecycle and if/when items count towards the plan limit?
Hey Chris,
Thanks for outlining this questions - I’ve reached out to the team who own storage to get their recommendations for optimising staged uploads, will update here when I hear back from them.
Hi again Chris,
So I got a bit more info from the product team on this:
- Is there any endpoint I can query that will tell me how much storage is currently used?
No, There is currently no endpoint that can be used to determine how much storage is used/available. But I’ve registered this as a feature request to the team.
- Is there any query which will produce a files list which are not referenced by a product?
It’s possible to filter by references, so you could query all files and remove the ones returned by a query which is filtering on used. We allow to show “used in” in admin.
- I hope it doesn’t count towards the quota.
The product team has confirmed it doesn’t count towards the quota.
Hope this helps Chris!
It’s not an api endpoint or anything, but I made a simple app that can show file usage
I now have a small, critical followup question.
If some asset, such as a product instruction or warranty card is uploaded via stagedUploadCreate, and then attached to two different products via two different productCreateMedia mutations, are the bytes for storage only count once?
Hi again Chris,
Will connect with the product team on this!
The product team has confirmed that if an asset is attached to two different products via two different productCreateMedia mutations it would count twice.
This is still pretty broken. I’ve a store that hit the storage limit. We reworked publication model to leverage de-duplicated media id references that are in some cases common among more than one product. Now I’m transitioning all the products to the model, removing old images and uploading new ones.
No matter what I do, the storage quota errors will not go away. Finally yesterday I decided to use the hammer approach. I did huge delete, removing about 90,000 files from the store, probably in the ballpark of 20GB. Storage quota errors persisted and so I decided to give it 24 hours to settle… maybe storage usage is not immediately recalculated…
Today. I was able to upload about 4MB, 15 files, and now I’m hitting the storage limit errors again. This is certainly frustrating, I’m driving blindfolded with handcuffs and a flat tire.