Last week, I edited an already published post. I published it. It worked fine. Then, I tried re-editing the post a second time. I got an exception. The error suggested that there was an error in updating the Archive.xml file.

On further analysis, I figured out that the publish date was showing up as Jan 1, 1900 while publishing the post (for the second time). I remember this was working fine. But, I have never tried editing and reediting a post.

I put a breakpoint on the Compose action of the Post controller. While editing for the first time, the breakpoint was hit. The post was published fine. While doing another edit (the second time), the breakpoint was not hit. I suspected a caching problem.

I have not enabled OutputCache in the server. So, IE was caching the Compose page very cleverly. I verified my assumption by using Fiddler. Fiddler suggested that the browser was serving the page from the cache.

So, I added one line of code to prevent browser caching:


Response.Cache.SetCacheability(HttpCacheability.NoCache);

It is working fine now. A published post can be reedited and republished as many as times as you want. (hopefully in all browsers).