0

I want to configure my lighttpd to serve some static files, with compression capability. The files are plain text but they have .bin extension. I have these lines in my lighttpd configuration:

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ("text/plain", "text/html", "application/x-javascript", "text/css")

And it works for css and js files, but not for the .bin files.

Here is the output of file -i for one fo those .bin files:

8_1.bin: text/plain; charset=us-ascii

How can I determine the file type of this file the same way lighttpd does it?

Reza Mohammadi
  • 217
  • 2
  • 6

2 Answers2

2

/etc/mime.types by default defines .bin files as a "application/octet-stream", so please try add "application/octet-stream" to your compress.filetype table

voretaq7
  • 79,345
  • 17
  • 128
  • 213
jamzed
  • 1,080
  • 7
  • 8
  • that is a stupid idea. map ".bin" to a better mime type (for example the output that `file` gave you). you don't want to compress all application/octet-stream files. See http://redmine.lighttpd.net/projects/lighttpd/wiki/Mimetype_assignDetails – Stefan May 21 '13 at 16:44
  • I think that mapping .bin to text/plain is a terrible idea... but of course you have right to present your point of view ;-) – jamzed May 21 '13 at 17:09
-1

You should have a MIME file containing a dictionary related to all filetypes.

Dr I
  • 943
  • 16
  • 33
  • hum... why the hell is someone downgrading this answer? The upper one, which has been posted at the same time contain the same answer!! – Dr I May 23 '13 at 15:43