-2

I can't find any information online about this, hopefully someone here can help out.

Our website hosts MOV downloads, but server space has started to become a concern. We have found that RAR can reduce the file size by as much as 70%. Unfortunately if users download .rar items it would require that many of them install 3rd party extraction software, and we want to avoid that.

How might Apache extract a .rar file on the fly before sending the extracted contents to a user? (so users would download the MOV extracted file). If this type of inflation is feasible, are there any latency or CPU concerns I would need to consider? What Apache modules, or directives might work to accomplish this?

  • This is the exact opposite of `mod_deflate` which compresses the file before sending it over the network. If it reduces the file size with up to 70%, I would try to send it compressed over the network and then look into how the client can uncompress it. Perhaps look into a custom movie player? – Tommiie Jan 31 '19 at 10:24
  • nginx has an option `gzip_static` that can serve gzip compressed files directly to a user agent without having them uncompressed first. The user agent automatically uncompresses them upon receiving the data, if it supports gzip (and virtually all do). Of course, storage is cheap... – Michael Hampton Feb 04 '19 at 02:15

1 Answers1

0

Use 7Zip instead. It's free and it compresses better than rar.

For both 7zip and rar, you have to option to extract an archive via command line.

Example:

7za -oC:\ -y -pPassord x Archive.7z

(The above is the command line that extracts archive.7z to C:\ with the password 'Password')

Given such built-in functionality, which also exists in most archivers since MS-DOS era, I'm sure you just need to run this from apache and you'll have your file.

Of course, you will have to adapt the serving code a little, but that's something also relatively easy.

Overmind
  • 2,970
  • 2
  • 15
  • 24