Classes and Containers

Containers

A container is an instance of a service. It is a place to store files. Configuration is service-specific, e.g. a filesystem container needs to know the directory where the files should go; an S3 container needs account credentials along with the bucket name.

Screencasts

Note these screencasts were recorded in 2012 and certain things could be different.

The following screencasts demonstrate some of the features of Storage API:

Data URIs

Instead of linking to a file, Data URIs contain the file itself. This means that images can be embedded directly into HTML documents.

For pages with small images (thumbnails) this is can really increase front-end performance. There is a per-file overhead, so downloading lots of small files (even on a fast connection) can be slow.

The downside is that they are cached with the page. If the same image is to appear on another page, it will have to be embedded into the document again. It does not make sense for large images to be embedded as data URIs.

Also, they should not be used for files greater than 32kB anyway as IE8 will not support them.

IE6 and 7 do not support data URIs. All other browsers have good support.

Storage API 7.x-1.1 will be able to output data URIs, but it requires Drupal core to support them. It does not yet, but you can apply the D7 patch from #1342504: Support data URIs.

It may be necessary to delete the variable filter_allowed_protocols after applying the patch.

Containers serving data URIs should be local so that they can be read quickly by Drupal. A class should be created have the data URI option enabled. This can then be specified in image styles as the class for thumbnails.

Subscribe with RSS Subscribe to RSS - storage_api