Permalink
Browse files

webserver: only cache HTML files for a day

  • Loading branch information...
1 parent e3c5071 commit ccbb11d1cf7db0006b781e49b22b235e64b730d8 @Montellese committed Sep 4, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 xbmc/network/WebServer.cpp
@@ -436,7 +436,10 @@ int CWebServer::CreateFileDownloadResponse(struct MHD_Connection *connection, co
// set the Expires header
CDateTime expiryTime = CDateTime::GetCurrentDateTime();
- expiryTime += CDateTimeSpan(365, 0, 0, 0);
+ if (mime && strncmp(mime, "text/html", 9) == 0)
+ expiryTime += CDateTimeSpan(1, 0, 0, 0);
+ else
+ expiryTime += CDateTimeSpan(365, 0, 0, 0);
MHD_add_response_header(response, "Expires", expiryTime.GetAsRFC1123DateTime());
// only close the CFile instance if libmicrohttpd doesn't have to grab the data of the file

0 comments on commit ccbb11d

Please sign in to comment.