jgauffin / Griffin.WebServer

A web server built on top of Griffin.Framework
107 stars 42 forks source link

If-Modified-Since problem #10

Closed wo80 closed 11 years ago

wo80 commented 11 years ago

There's a minor problem with the DiskFileService setting the FileContext's IsModified flag:

Say your disk file time has: Ticks = 635014822668060745

But the browser's If-Modified-Since tag ignores milliseconds: Ticks = 635014822660000000

So in DiskFileService.GetFile() you should do something like

var date = File.GetLastWriteTimeUtc(fullPath);
date = date.AddTicks(-(date.Ticks % TimeSpan.TicksPerSecond));
if (date <= context.BrowserCacheDate) ...
jgauffin commented 11 years ago

thanks. fixed. But why don't you join the project? :)