Asset data in Statamic v2 is stored in your asset container's YAML file. This worked fine on a small scale, but if you found yourself with a lot of assets in a single container with lot of meta data (e.g. alt text, focal points, etc), that YAML file becomes enormous. Parsing that file becomes an expensive operation, and since asset containers are available on every request, your site may experience noticeable slow-downs.
So we fixed yet another thing with Statamic 3
Statamic 3 changes how asset meta data is stored. It brings better performance, happier developers, and content managers will never tell the difference.
While the asset containers themselves still need to be available on every request, the meta data doesn't. So we separated them.
In Statamic 3, every asset will have its very own meta file.
The benefits thereof
- No need to parse a potentially gigantic YAML file just to fetch the data for a single asset.
- The container's YAML now only holds configuration, instead of mixing it with content (which allows better separation of concerns for your version control strategy of choice).
- If you want to version the meta data, go for it. If not, one line in your gitignore files stops it.
- Now that the data travels along with your assets — if you're using S3 — your data will also be on S3.
Statamic 3 also stores extra meta data like file size, dimensions, modification dates, EXIF information, and more.
Storing this data will improve performance because it only happens once, instead of needing to constantly check the actual asset (like we do in v2). For those using S3, this will significantly reduce your number of API requests.
And there you go. More good stuff. Have a great weekend!