I'm trying to keep CSS from caching. To do so I'm trying to time stamp my CSS. In including CSS the basic way would look like this:
<link rel="stylesheet" type="text/css" href="style.css?Thursday 24th of April 2008 04:45:21 PM" />
But on my project I am using BundleConfig
to handle all CSS and JavaScript includes:
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content/myStyles").Include(
"~/Content/Styles/style1.css",
"~/Content/Styles/style2.css",
"~/Content/Styles/style3.css"));
}
}
I read about Bundle.CacheLookup
and Bundle.UpdateCache
, but I am confused. I don't think they are what I'm looking for.
What do I do with my BundleCollection
to get it to include the question mark and a date time value when it produces the basic CSS call for the browser?