Class YuiHeaderCache

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.markup.html.IHeaderContributor, org.apache.wicket.util.io.IClusterable

    public class YuiHeaderCache
    extends Object
    implements org.apache.wicket.markup.html.IHeaderContributor
    A Wicket Ajax request can generate a response containing additional javascript and css resources to be loaded on the client. Subsequently requesting a component that depends on, for example, six YUI-modules that have to be loaded in a pre-defined order, will lead to lot's of redundant data in the response, not to mention the IO and file parsing that is produced by the YUI module loading mechanism on the server.

    This class uses the CachedYuiDependencyResolver to retrieve the Set of resources belonging to a YUI-module and caches them locally. YuiContexts will share a reference to the resources, making it possible to skip static resources that have already been loaded on the client.

    It will automatically load the YUI-logger through it's local IYuiContext when running in Wicket development mode. See Application.getConfigurationType().
    It will also the Wicket-Ajax javascript dependencies if needed and subsequently load the hippoajax YUI module, which adds cleanup-hooks for YUI modules as well as some other utility methods.

    See Also:
    Serialized Form
    • Constructor Detail

      • YuiHeaderCache

        public YuiHeaderCache​(boolean loadWicketAjax)
    • Method Detail

      • renderHead

        public void renderHead​(org.apache.wicket.markup.head.IHeaderResponse response)
        Specified by:
        renderHead in interface org.apache.wicket.markup.html.IHeaderContributor