playframework - Caching of renderBinary responses -
i trying customize serving of static resources renderbinary(). serve these assets through controller optionaly checks authorization , serves appropriate file. cache file 1 year never change.
the method in controller looks this:
public static void item(string item) { // check authorization ... response.cachefor("365d"); renderbinary(play.getfile("static/" + item)); }
the problem having play automatically adds etag , caches 1 hour when using renderbinary, net effect firefox re-issues request these files again when needed, 304 response play server.
i know can achieve thing nginx frontend using play.
this known bug in play, see https://play.lighthouseapp.com/projects/57987-play-framework/tickets/772-overwritten-of-cache-control-header-when-apply-renderbinary-to-a-file
Comments
Post a Comment