0

Hi I couldn't find much online on how to gzip a .obj file I did manage to compress it changing the files extension to .gz but this isn't desirable in my case. I want to gzip the .obj file as it's 13mb is this possible to do with the .htaccess file and how would one go about it? (keeping the .obj extension).

Thanks in advance!

pailhead
  • 5,162
  • 2
  • 25
  • 46
ui-unicorn.co.uk
  • 151
  • 1
  • 5
  • 17

1 Answers1

3

Possible. Using mod_deflate module and modify the .htaccess as follow:

<ifmodule mod_deflate.c>
    <ifmodule mod_mime.c>
        Addtype text/plain .obj
    </ifmodule>
    AddOutputFilterByType DEFLATE text/plain
</ifmodule>

Before compression:

> curl --compressed -so /dev/null http://localhost/foo.obj -w '%{size_download}'
464590

After compression:

> curl --compressed -so /dev/null http://localhost/foo.obj -w '%{size_download}'
148261
Ben
  • 5,069
  • 4
  • 18
  • 26