// apply caching if required
if (resource instanceof IStaticCacheableResource)
{
// add caching related information to filename + query parameters
final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
final ResourceUrl resourceUrl = new ResourceUrl(token, parameters);
getCachingStrategy().decorateUrl(resourceUrl, cacheable);
token = resourceUrl.getFileName();
Checks.notEmpty(token, "Caching strategy returned empty name for '%s'", resource);