Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7729803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:03:51+00:00 2026-06-01T06:03:51+00:00

I am trying to customize serving of some static resources with renderBinary(). I would

  • 0

I am trying to customize serving of some static resources with renderBinary().
I would like to serve these assets through controller which optionaly checks
authorization and serves appropriate file.
I would also like to cache some file for 1 year as they never change.

The method in my controller looks something like this:

    public static void item(String item) { 
             // check authorization ... 
             response.cacheFor("365d"); 
             renderBinary(Play.getFile("static/" + item)); 
    } 

The problem I am having is that play automatically adds Etag and
caches it for 1 hour when using renderBinary, so the net effect is that
firefox re-issues request for these files again when needed, only to get
304 response from play server.

I know I can achieve thing with nginx as frontend but would like to do it
using only play.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:03:52+00:00Added an answer on June 1, 2026 at 6:03 am

    This is a 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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to customize that context menu which comes up when you right click
I'm trying to customize a wordpress page to include an iframe which give the
I was just trying to customize some org-mode export settings in emacs, and so
Trying to customize my back button in a drilldown navigation controller. On my one
I am trying to customize date from my RSS feed to display like how
I am trying to customize the authorize in mvc 3. In the home controller
I'm trying to customize some TFS work items via the VS2008 xml editor, but
I'm currently trying to customize OpenCms (java-based open source CMS) a bit, which is
I'm trying to customize the icons drawn by the GDirections object. I've got a
I am trying to customize a UITableView. So far, it looks good. But when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.