Experimental project

This is a sandbox project, which contains experimental code for developer use only.

IMPORTANT - Module Obsolete: Most of the use cases served by this module have now been addressed in other ways within the main Juicebox HTML5 Responsive Image Galleries module.

This module provides a small "caching" extension to the Juicebox HTML5 Responsive Image Galleries module that allows the XML-based configuration for each gallery to be delivered via a local caching mechanism instead of being built in isolation. It's primary purpose is to bypass limitations introduced by 3rd party modules that don't deal with fields in a native way (such as Panel Nodes). More technical details are listed below but put very simply you probably want to try this module if you see a warning like the following while configuring a Juicebox gallery:

You appear to be using the Juicebox field formatter with a field instance that is not directly attached to an entity. This configuration is not officially supported and will likely not work as expected.

If you encounter this warning in the configuration there is a good chance that you also see an "XML not found" error when trying to view the gallery itself. By installing this module the configuration warning above will not go away, but the gallery itself should start working as expected.

This module may also offer a performance advantage in some cases, specifically when field-based galleries receive an exceptional amount of traffic from logged-in users that cannot be serviced by standard Drupal caching.

Installation Instructions

  1. Grab the module via Git or download a snapshot manually from the repository. If you download manually be sure to extract the archive and rename the resulting directory to juicebox_xml_cache.
  2. Enable the module as normal (note that you'll need to have version 7.x-2.0 or greater of the main Juicebox module installed).
  3. No matter what results you have (successful or not) please leave a note in the issue queue detailing what type of field-based configuration you are working with, etc. This will help to determine if some caching functionality like this should ever be bundled directly into the main Juicebox module.

More Details

Juicebox galleries depend on two requests that must go through the Drupal menu system, one to construct and deliver the page that contains the actual embedded gallery, and another to construct and deliver the "config" XML that describes the gallery. When the Juicebox field formatter is used with a "non standard" field instance, some of the configuration details cannot be reliably passed between both the embed page request and the XML request (given the stateless nature of each request). This is not an issue for standard field instances, but has been know to cause problems with some specific (but relatively uncommon) configurations, see more at:

This module provides a tool to generate an "XML Cache" when the embed code is created, and then use that to retrieve the XML on later (separate) XML requests. This saves a bit of redundant gallery "building" processes, but more importantly it makes it easier to retrieve the correct XML data without needing to be aware of all the custom ways 3rd party tools may store and manage field configurations. In other words, the code needed to build the gallery XML does not necessarily need to know how to re-build the whole gallery, it just needs to know what cached XML to fetch (as keyed by a simple checksum passed in the URL).

From a performance perspective, this caching is redundant to Drupal's own native page caching, so it would probably not provide much of a speed advantage in most cases.

Potential Limitations

It's not yet known if this local XML caching technique will play nicely with all external caching tools (reverse proxies, etc.), as it's possible that the XML could become out of sync with the embedded gallery itself. This is why this tool has not been added natively to the main Juicebox module.

Project information