Tuesday, April 22, 2008

Cacheable ASP.NET pages

Or "Caching ASPX pages"
Or "How to make ASP.NET pages be stored in the browser's cache?"

I used to save every static page in my Web Projects as .HTML files. But Sandro, from MS-Developers taught me how to make cacheable ASPX pages:

Just insert the following C# .NET code into the Page_Load
Response.Cache.SetExpires(DateTime.Now.AddYears(3));
Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
You can use the if(!IsPostBack) condition enclosing the code above, for AJAX Pages.

Researching a little more I found an alternative method, just include in the beggining of the ASPX file:
<%@ OutputCache Duration="31536000" Location="Any" VaryByParam="none" %>
As written at ASP Alliance ASP.NET reference

But if you want to disable cacheability use the following code:
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);

Wednesday, April 16, 2008

Simple Windows Drumkit

Would you like to play drums while do you hear your songs? Even if it's only to play while you wait or download something? This app could be nearly invisible so you could play without disturbing you normal pc use, and to avoid your bosses' eyes.

With a couple of work hour I made this Simple Drum Kit, that fullfills all those requirements, and beyond, because it uses WAV files that can be replaced at your taste. Here's some suggestions:

- Special effects
- Backing vocals
- Percussion
- Melodies
- Bases
- Other music

To download follow the link:
http://www.codeplex.com/skd