0

I've installed lighttpd 1.4.33 /not mod_cache patched/ on Ubuntu 14+. I've put .html file with embedded .unity3d on server (unity3d file is somewhere 50+ Mb.)

lighttpd.conf do contain mod_expire, mod_setenv, mod_compress. also, configuration do include following lines:

$HTTP["url"] =~ ".unity3d" {
expire.url = ( "" => "access plus 7 days" )
setenv.add-response-header += ("Cache-Control" => "public, must-revalidate")
}

Every time I open this page, unity3d application starts to download again, not just opening from cache.

Here is what curl -I shows:

HTTP/1.1 200 OK Cache-Control: public, must-revalidate, max-age=604800
Expires: Tue, 17 Mar 2015 05:13:51 GMT 
Content-Type: application/vnd.unity 
Accept-Ranges: bytes 
ETag: "2535721273"
Last-Modified: Thu, 05 Mar 2015 12:39:07 GMT 
Content-Length: 56645063
Date: Tue, 10 Mar 2015 05:13:51 GMT 
Server: lighttpd/1.4.33

I did mention mime-type for unity3d files in proper config file.

Does anyone have experience or any thoughts on the issue?

user275407
  • 11
  • 2
  • downgraded to v1.4.26 + mod_cache to very same result – user275407 Mar 11 '15 at 05:45
  • You might want to clarify what you mean with "lighttpd is not caching files" - lighttpd never caches files, it just returns appropriate headers and may answer "304 Not Modified" given certain requests. – Stefan Mar 12 '15 at 08:59
  • probably, you are right on title. I just wondering why unity file is not cached. I had an experience with pre-installed Apache and very same application. Tho, servers pings difference was significant (apache was closer, difference was x2), application acted like it was run from cache - the loading was in a snap. I heard a lot about lighttpd, but, unfortunately, can't make it run the way i want. – user275407 Mar 17 '15 at 10:05
  • What did you expect to happen? a simple curl request will always return "200" - you need to give it some meta data from last time you downloaded the file to get a "304 Not Modified". See http://stackoverflow.com/a/20978279/1478356 – Stefan Mar 17 '15 at 17:49
  • @Stefan, thank you! The thing was in size, actually. The files were too large. – user275407 Mar 27 '15 at 11:50

0 Answers0