-2

Possible Duplicate:
Make maven serve files like css.gz and js.gz

When I use file like style.css and run in browser, it works well but when I compress the file become style.css.gz and run it again, it not works at all. So, I just want to ask how to configure so the compressed file like that can be work well in browser???

In this case I'm working with a Java EE project and using Apache Maven.

Community
  • 1
  • 1
cakduro
  • 180
  • 2
  • 13
  • Check out this SO question: http://stackoverflow.com/questions/10894779/gzip-compression-for-jsf-stuff. And this question is more or less a duplicate of your own question: http://stackoverflow.com/questions/12668970/make-maven-serve-file-like-css-gz-and-js-gz – maba Oct 01 '12 at 10:02

1 Answers1

3

You need to add special response header which will tell your browser that your content is encoded as gzip, for example in C#:

  Response.AppendHeader("Content-Encoding", "gzip");

In this case browser will automatically decompress your file.

PhonicUK
  • 13,486
  • 4
  • 43
  • 62
Alex
  • 329
  • 2
  • 17
  • I know that I can use that way, I'm can do it in PHP project but the problem that I want to know about the step to configure in J2EE project, because I'm new in here... Thanks... – cakduro Oct 01 '12 at 09:17
  • [How to set RESPONSE Headers globally using J2EE container](http://stackoverflow.com/questions/1676953/how-to-set-response-headers-globally-using-j2ee-container-websphere) or by config [responseheaderfilter](http://code.google.com/p/responseheaderfilter/) – Alex Oct 01 '12 at 09:29