.NET Weblogs Archive

Made some changes to the .NET Weblogs Archives tonight per the request of Luke. The archiver should now understand the Last Modified header and act appropriately, so that the archiver doesn't use your bandwidth unless there are actually new items. If you support the header on your feed, please give it a check and let me know if it isn't functioning properly. The code looks fine to me and appears to be working, but appearances can be deceiving :-).

6 Comments

  • I'm still seeing every request from activehead.com resulting in the full rss-feed being sent over.





    What you need to do is get the Last-Modified and ETag headers from the webresponse on a successful request:





    string lastModified = response.Headers.Get("Last-Modified");


    string eTag = response.Headers.Get("ETag");





    and store these with the feed. Then on the next request, you set these on the HttpWebRequest:





    httpWebRequest.IfModifiedSince = DateTime.Parse(lastModified);


    httpWebRequest.Headers.Add("If-None-Match", eTag);





    If the file has not been changed, the WebRequest will throw a WebException when you try to get the file. This exception will contain a HttpWebResponse with a StatusCode of HttpStatusCode.NotModified.





    Also: could you set the httpWebRequest.UserAgent to something like "dotNetWeblogsArchive/1.0"?

  • Ok, thanks for the heads up (I wasn't supporting eTags). Uploading your changes now... let me know if they solve the issue.

  • Just checked my logs and it looks perfect now. The UserAgent is set, and my site typically returns 304 (not-changed) responses. Thanks!

  • Hello, nice site look this:
    gay sex [url=http://www12.asphost4free.com/gaysexonly/]gay sex[/url]
    viagra online
    viagra online
    viagra online
    mature sex [url=http://naturesexz.bravehost.com]mature sex[/url]

    End ^) See you



Comments have been disabled for this content.