The answer to ASP.Net cache cache variables is to use one of the CSS / JS mini-library libraries .
I thought cache buffer variables should be updated every time we deploy them to our servers, but widget libraries use a hash tag based on the contents of individual CSS / JS files.
Since I am developing the .Net 3.5 website, my options have been a bit limited. I ended up using SquishIt (available as a NuGet package) and it was easy to integrate.
<link href="/<my_css_path>/<css_file_1>.css" rel="stylesheet" type="text/css" /> <link href="/<my_css_path>/<css_file_2>.css" rel="stylesheet" type="text/css" /> <link href="/<my_css_path>/<css_file_3>.css" rel="stylesheet" type="text/css" />
has become
<%= Bundle.Css() .Add("~/<my_css_path>") .Render("~/<my_css_path>/combined_#.css") %>
and thatβs basically it! A similar idea with javascript. As long as debug="true"
in your web.config for local development and debug="false"
for your intermediate / production environments, SquishIt will leave your CSS / JS unallocated and unminified for local development, and then combine, minimize and hash (for brute force) cache) for other environments.
source share