Clear CSS Stylesheet cache

Stephen Rushing asked on March 9, 2015 22:57

I have some custom classes that affect my stylesheet(s), and I'm having trouble figuring out how to clear the CSS cache and/or trigger the stylesheet's dynamic code to be re-processed.

I've tried via the CacheHelper:

CacheHelper.ClearCSSCache();

I've tried touching the cache keys of the stylesheet:

CssStylesheetInfoProvider.GetCssStylesheetInfo(SiteContext.CurrentSite.SiteDefaultStylesheetID).TouchKeys()

Neither seem to have an effect -- any ideas on what I'm missing?

Thanks, Stephen

Recent Answers


Jan Hermann answered on April 23, 2015 14:50 (last edited on April 23, 2015 14:52)

Hello,

according to our documentation, please use following code instead:

CacheHelper.TouchKey("cms.cssstylesheet|byname|<styleheetname>");​

Best regards,
Jan Hermann.

0 votesVote for this answer Mark as a Correct answer

eSiteful Corporation answered on April 23, 2015 15:27

This may clear the cache for the GetResource and GetCSS pages, but it doesn't seem to reprocess the StylesheetDynamicCode to reproduce what's stored as StylesheetText.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.