开发者

Sharepoint If-Modified-Since

I wrote a handler to be used within SharePoint that will generate a JSON string from a given parameter in the query-string. This JSON string will then be used by a JS function to display the relevant data in HTML to the client, however, the call is somewhat costly and would like to cache the output once.

The handler currently caters for everything regarding OUTPUT cache and tested within an application bares fruits, however, I'm baffled by the fact that, specifically in SharePoint (2007) the "If-Modified-Since" header attribute never appears, basically it always comes back as null.

I found blog-on-blog that discuss this in length in regards to images, and include files but I can't find anything specific regarding this with pages (ASPX, AXD, ASHX) and the handler self.

My only assumption here is the fact that I'm using an AXD file, which is not directly supported by OUTPUT cache by default?

The code looks something like:

bool isModifiedSi开发者_开发知识库nceLast = (context.Request.Headers.Get("If-Modified-Since") != null)
     : true
     ? false;

if (!isModifiedSinceLast)
{
    context.Response.Headers.AppendHeader("If-Modified-Since", Guid.NewGuid());
}
else
{
    // complete the call from cache
}

Thanks,

Eric

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜