Skip to content

Instantly share code, notes, and snippets.

@fkleon
Created December 22, 2015 19:13
Show Gist options
  • Save fkleon/ca12c8f370bb5cda7e02 to your computer and use it in GitHub Desktop.
Save fkleon/ca12c8f370bb5cda7e02 to your computer and use it in GitHub Desktop.
Alfresco extension to enable Dojo's cacheBust to test compatibility with Aikau
<#assign webframeworkConfig = config.scoped["WebFramework"]["web-framework"]!>
<@markup id="dojoCacheBust" target="setDojoConfig" action="after" scope="global" >
<#if webframeworkConfig.dojoEnabled>
<script type="text/javascript">
// Enable Cache Bust for testing
dojoConfig.cacheBust = Date.now();
</script>
</#if>
</@>
<extension>
<modules>
<module>
<id>DOJO_Cache_Bust_Enabler</id>
<auto-deploy>true</auto-deploy>
<auto-deploy-index>0</auto-deploy-index>
<evaluator type="default.extensibility.evaluator"/>
<customizations>
<customization>
<targetPackageRoot>dojo</targetPackageRoot>
<sourcePackageRoot>dojo.cache</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
@fkleon
Copy link
Author

fkleon commented Dec 22, 2015

Those files should live in a JAR under the following paths:

  • alfresco/site-data/extensions/dojo-cache-bust-enabler-extension.xml
  • alfresco/site-webscripts/dojo/cache/dojo-bootstrap.get.html.ftl

The JAR can then be deployed to the lib/ folder of any Spring Surf webapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment