{ro.isdc.wro.cache.CacheKey@4ae8f929[
type=JS
groupName=primo_library_web
minimize=false
map={}
]=hash: 76bfa243316aa083f53c71c1305cd838e9079f35, ro.isdc.wro.cache.CacheKey@38870b41[
type=JS
groupName=primo_library_web
minimize=true
map={}
]=hash: db778d83d4e85805862b1de5b749624be98d8f01, ro.isdc.wro.cache.CacheKey@207c00fb[
type=CSS
groupName=primo_library_cssen_USAuto1
minimize=true
map={}
]=hash: 28a5ac0da42bdcc36add114b191793b54d145467, ro.isdc.wro.cache.CacheKey@618901d5[
type=JS
groupName=primo_library_cssen_USAuto1
minimize=true
map={}
]=hash: 64a9c7181c32e30a94ff658a7b96705cc6d7ed0a}
public class PrimoWroCacheKeyFactory implements CacheKeyFactory { @Inject private GroupExtractor groupExtractor;
/** * This method is important because there are some groups that their names are Loacle based. * * @see PrimoWroModelFactory#create() * @see PrimoWroModelFactory#createCssGroups(javax.servlet.http.HttpSession, HttpServletRequest, java.util.List, java.util.List) */ @Override public CacheKey create(HttpServletRequest request) { notNull(request); CacheKey key = null; String groupName = groupExtractor.getGroupName(request); final ResourceType resourceType = groupExtractor .getResourceType(request);// if(ResourceType.CSS == resourceType){ if(groupName != null && groupName.startsWith("primo_library_css")){ //makes sure the cache is built differently for languages -- only css groupName = PrimoWroUtility.generatePrimoCacheKey(groupName,request); } final boolean minimize = groupExtractor.isMinimized(request); if (groupName != null && resourceType != null) { key = new CacheKey(groupName, resourceType, minimize); } return key; }
}
public class PrimoWroUtility { public static String generatePrimoCacheKey(String wroKey,HttpServletRequest request){ String locale = SessionUtils.resolveLocale(request.getSession(), request); String primoViewId = SessionUtils.getPrimoView(request).getId(); return generatePrimoCacheKey(wroKey,locale,primoViewId); } public static String generatePrimoCacheKey(String wroKey,String locale, String primoViewId){ return wroKey += locale += primoViewId; }
}