Spotlight IT Ramblings Blog

I'm living in Dublin, Ireland and this is a collection of ramblings about my day-to-day activities in the exciting world of web development ;-) Technologies used and projects under development. Also links of interest, mostly completely work un-related....

Thursday, August 24, 2006

Forcing pages to expire in .Net 2.0

Add the following

<meta http-equiv="Expires" content="0" />

<meta http-equiv="Cache-Control" content="no-cache" />

<meta http-equiv="Pragma" content="no-cache" />

To the HTML in the <title> element of your master pages for your projects, Pragma: no-cache prevents caching only when used over a secure connection. A Pragma: no-cache META tag is treated identically to Expires: -1 if used in a non-secure page. The page may be cached but marked as immediately expired.

As some browsers ignore these META tags so also added HTTP headers to expire in the master page code-behind in the Page_Load event

Response.Cache.SetCacheability(HttpCacheability.NoCache)Response.Cache.SetNoStore()

Response.Cache.SetExpires(DateTime.MinValue)

This is about all you can do to try to force the browser to not cache a page.

The only other place where caching could be set is in the IIS virtual directory properties, in the HTTP headers tab there is an option to "Enable Content Expiration" which can be set to "Expire Immediately". This should effectively add the same headers that the code behind Response.Cache calls was doing.

There is obviously a lot of overlap with all these techniques. You can install the free ieHTTPHeaders toolbar into IE http://www.blunck.info/iehttpheaders.html to ensure all these headers are set correctly.

If you had control over all the client machines we could change Internet Explorer on the "General Tab", "settings" option to "Check for newer versions of stored pages" to "every visit to the page". Which should disregard any cached items client side.

 

 

 

Thursday, August 10, 2006

ASP.Net 2.0 Themes, Styles, Skins and Layout

Download these professionally designed Starter Kits and XHTML templates to get you started creating compelling, standards-compliant Web pages with ASP.NET 2.0. There are four Starter Kits. These Starter Kits are complete web site solutions using ASP.NET’s latest controls (tree view control, grid view control, detail view control, login control, site map path controls and more). There are another 5 XHTML templates.

These are individual XHTML strict Web page templates (available each in two different colors) that are accompanied by design philosophy whitepapers that describe each template’s Section 508 conformance, page layout with CSS (page layouts using CSS floats or tables), Web page accessibility best practices and Web standard resources.

All nine templates are easily customizable and extendable to fit your own content.

Skin Templates

 

Valid CSS!
news section