How to disable Etag in Play 2.3 and change the cache-control , its using default in production mode

185 views
Skip to first unread message

Krishan Tyagi

unread,
Nov 3, 2017, 12:38:35 PM11/3/17
to Play Framework
Hi Team,

Greeting for the Day!

I am new to this group and as to play framework. I need to fix the issue related to Etag in play framework, which is automatically generated by  play.( https://www.playframework.com/documentation/2.3.x/Assets#etag-support)
Here are the my questions: 
1. I want to disable  Etag generation by play. I had tried http.useETag=false , but does not works for me. 
2. I tried to change the max-age for cache, still it using the default 3600, how can I change it.
3. How can I override the assets controller code using java, where I can find out the assets controller code.


Please help.

Thank you i advance.

Krishan

Marcos Pereira

unread,
Nov 3, 2017, 12:54:12 PM11/3/17
to play-fr...@googlegroups.com
Hi Krishan,

1. There is not a configuration for that in Play 2.3. But you can strip the headers using a Filter (see docs here).
2. How did you change that? There are some docs here about how to configure it. Also, there is `assets.defaultCache` and `assets.aggressiveCache`. For both, the configuration format is the expected value for the header (for example `public, max-age=3600`).
3. Why do you need to do that? Assets controller solves a lot of problems to you. Anyway, the code is here: https://github.com/playframework/playframework/blob/2.3.x/framework/src/play/src/main/scala/play/api/controllers/Assets.scala

Best.

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b953c7cb-478b-4eb3-9010-c2e057dc3139%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

Reply all
Reply to author
Forward
0 new messages