Skip to content

Instantly share code, notes, and snippets.

@emiaj
Created March 17, 2012 04:06
Show Gist options
  • Select an option

  • Save emiaj/2054836 to your computer and use it in GitHub Desktop.

Select an option

Save emiaj/2054836 to your computer and use it in GitHub Desktop.
public class AssetsWarmUpPolicy : IAssetPolicy
{
private readonly IAssetRequirements _requirements;
private readonly IAssetTagPlanCache _planCache;
public AssetsWarmUpPolicy(IAssetRequirements requirements, IAssetTagPlanCache planCache)
{
_requirements = requirements;
_planCache = planCache;
}
public void Apply(IPackageLog log, IAssetPipeline pipeline, AssetGraph graph)
{
// WARM UP
new[] { "site-css",..... }
.Each(x =>
{
_requirements.Require(x);
_requirements.DequeueAssetsToRender()
.Select(_planCache.PlanFor)
.ToList();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment