So, this module converts your images from image files to Data URIs. Groovy. But when? Each time the page is requested, over and over again? That's what today's running Faster Images code does — but that's not ideal. At all. If your site is using memcache/vanish, then the Data URIs are cached server-side, and there's not a problem. But most sites aren't using that kind of server-side caching.
We need to store the Data URI data somewhere, to be reused later. But where?
We could save them in the database (Views and other things cache their information in the database)… but the database would get huge. These files are as big as images, so the database could quickly become gigabytes in size. Bad.
We could store them in individual files, but would grabbing the info out of each separate file on page request be tolerable? Does that work?
We could store them all together in one file, but, uh…
Server RAM?
This doesn't seem like a Drupal-specific problem. This seems like something that there should already be a solution for. What are people who use Data URIs doing?
Comments
Comment #1
drnikki commentedI wish this comment were to tell you that I found a solution. Instead, I did a quick cache experiment in which we use just Drupal's default cache get/set to store the data uri keyed off the path. It seems to work fine, but it's also still in the theme layer. I'd like to see this moved back into node save ... although, having it in the theme layer ensures we're only caching images which people are accessing instead of caching every piece of nonsense someone might upload.
Regardless, it its possible (and simple) to use drupal cache to store the uris. http://drupalcode.org/project/fasterimages.git/commit/2cb47aa