buunguyen / combres

ASP.NET and MVC performance optimization library ⛺
Other
123 stars 36 forks source link

Syncronization of last modified date on the response header. #30

Closed MiguelTVMS closed 10 years ago

MiguelTVMS commented 10 years ago

Hi.

We are having kind of a problem since our web site run on a server farm. The response header last-modified is different from one server to the other. Because of that we are unable to take advantage from having a 304 response. When the user hits a different server it gets a different date and because of that he download the file again.

I noticed in you code that in the method: Combres.RequestProcessor:SendOutputToClient(byte[], bool, string)

you have the line cache.SetLastModified(DateTime.Now);

To solve this problem i see two ways or event both.

  1. The user can set on the date he wants on the combres.xml on the resourceSet element.
  2. You can get the latest modified date from all the files composing the resourceSet. 1+2.Use the option 2 as default but the user can override this behavior by setting the value of option 1.

Thanks

MiguelTVMS commented 10 years ago

Please, disconsider since you already implement ETag.

Thanks.