http - Why doesn't chrome cache google app engine blobstore -


i'm using blobstore serve audio files embedded in html5 audio element. because have blobkey part of url can assume given url content never change. looks perfect setup caching.

yesterday implemented solution seemed work. @ least remember worked ;). unfortunately today discovered, doesn't work chrome , production server. works internet explorer , firefox. works chrome , development server - use version 1.7.6. solution uses cache-control headers, seems firefox makes use of it. additionally added etag header. when discover if-none-match request header same value return 304 code. seems work internet explorer. works chrome , development server. remember had worked yesterday chrome , production, i'm not sure. anyway problem have why both caching mechanisms ignored chrome. suspect may have chunked encoding generated chrome, don't understand why caching disabled in case

and lot of details.

firefox

initial request headers:

host: eduzabawy.appspot.com user-agent: mozilla/5.0 (windows nt 6.1; wow64; rv:20.0) gecko/20100101 firefox/20.0 accept: audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5 accept-language: pl,en-us;q=0.7,en;q=0.3 range: bytes=0- referer: http://eduzabawy.appspot.com/dziecko/ cookie: children="jedor1b8vrdrjrewmuvluq\075\075"; session=eyjfc2lkijoiwk91qmlsoejlted4qvfuyvfiykpstyj9|1365190508|81d81772f6f409dd57ad43a9f447f92d1b56d29e connection: keep-alive 

initial response headers:

http/1.1 206 partial content cache-control: public max-age=100000000 content-range: bytes 0-37249/37250 content-type: audio/ogg date: fri, 05 apr 2013 19:45:47 gmt etag: blobstore server: google frontend x-firefox-spdy: 3 

on subsequent loads seems firefox doesn't try fetch files. how thought should work.

internet explorer

initial request headers:

accept: */* user-agent: mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; wow64; trident/5.0) referer: http://eduzabawy.appspot.com/dziecko/ accept-language: pl-pl accept-encoding: gzip, deflate host: eduzabawy.appspot.com connection: keep-alive cookie: children="wyzuqwhezwx6qnjfn21kew\075\075"; session=eyjfc2lkijoia2vod0llr0hvrhu1cun0ce1qswrpwcj9|1365192921|f2279f82b21947c4d064dbf44a5ce9e1bd95cc0d 

initial response headers:

http/1.1 200 ok cache-control: public max-age=100000000 etag: blobstore content-type: audio/mpeg date: fri, 05 apr 2013 20:15:23 gmt server: google frontend content-length: 4637 

subsequent request headers:

accept: */* user-agent: mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; wow64; trident/5.0) referer: http://eduzabawy.appspot.com/dziecko/ accept-language: pl-pl accept-encoding: gzip, deflate host: eduzabawy.appspot.com if-none-match: blobstore connection: keep-alive cookie: children="wyzuqwhezwx6qnjfn21kew\075\075"; session=eyjfc2lkijoia2vod0llr0hvrhu1cun0ce1qswrpwcj9|1365192921|f2279f82b21947c4d064dbf44a5ce9e1bd95cc0d 

subsequent response headers:

http/1.1 304 not modified etag: blobstore content-type: audio/mpeg content-length: 4637 

chrome + development server

initial request headers:

host: localhost:8080 connection: keep-alive accept-encoding: identity;q=1, *;q=0 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.43 safari/537.31 accept: */* referer: http://localhost:8080/dziecko/ accept-language: pl-pl,pl;q=0.8,en-us;q=0.6,en;q=0.4 accept-charset: iso-8859-2,utf-8;q=0.7,*;q=0.3 cookie: children="xynsqzfdtz-2z764lfszk1ed8-g1qonlcaexsd79gsy\075"; session=eyjfc2lkijoite9czdc0shjenhf4owjua1j4s3dtqsj9|1365192253|37815772acab0bf44a0c501ea0fd0dc7c617dd09 range: bytes=0- 

initial response headers:

http/1.1 206 partial content etag: blobstore cache-control: public max-age=100000000 content-type: audio/mpeg content-range: bytes 0-4636/4637 content-length: 4637 server: development/2.0 date: fri, 05 apr 2013 20:32:19 gmt 

subsequent request headers:

host: localhost:8080 connection: keep-alive accept-encoding: identity;q=1, *;q=0 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.43 safari/537.31 accept: */* referer: http://localhost:8080/dziecko/ accept-language: pl-pl,pl;q=0.8,en-us;q=0.6,en;q=0.4 accept-charset: iso-8859-2,utf-8;q=0.7,*;q=0.3 cookie: children="xynsqzfdtz-2z764lfszk1ed8-g1qonlcaexsd79gsy\075"; session=eyjfc2lkijoite9czdc0shjenhf4owjua1j4s3dtqsj9|1365192253|37815772acab0bf44a0c501ea0fd0dc7c617dd09 range: bytes=0-4636 if-none-match: blobstore 

subsequent response headers:

http/1.1 304 not modified content-type: text/html server: development/2.0 date: fri, 05 apr 2013 20:33:08 gmt 

chrome + production server

initial request headers:

host: eduzabawy.appspot.com connection: keep-alive accept-encoding: identity;q=1, *;q=0 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.43 safari/537.31 accept: */* referer: http://eduzabawy.appspot.com/dziecko/ accept-language: pl-pl,pl;q=0.8,en-us;q=0.6,en;q=0.4 accept-charset: iso-8859-2,utf-8;q=0.7,*;q=0.3 cookie: children="su9aqnqef67ezfps7bksmw\075\075"; session=eyjfc2lkijoieflgwljlmnrwshjuovfcb1hatnjlucj9|1365194193|2a13cd9eb7aceeb40c43bd82a763d893436d9f1f range: bytes=0- 

initial response headers:

http/1.1 206 partial content cache-control: public max-age=100000000 etag: blobstore content-type: audio/mpeg content-range: bytes 0-4636/4637 date: fri, 05 apr 2013 20:36:35 gmt server: google frontend transfer-encoding: chunked 

subsequent requests , responses same initial.

your max-age seems long , going on 3 years... read somewhere maximum should set in gae no more 1 year.

anyway, there's 1 more header should try set (pragma: public), worked me (i'm caching image blobstore though, here's few lines source code):

httpresponse.header().set("cache-control", "public, max-age=600") httpresponse.header().set("pragma", "public") blobstore.send(httpresponse, project.imageblobkey) 

by way above cause google delivery file edge cache, speed static resources lot!


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -