Can we compact model files for RedirectDownload()? -
JR_Junior - 13.12.2017
Hello!
I would like to know if it is possible to compress (zip or similar) the files on the host to use in RedirectDownload ().
Thank you!
Re: Can we compact model files for RedirectDownload()? -
d0 - 13.12.2017
Quote:
- Adds support for URL redirection for model/texture downloads, which means you can host downloads on a web server instead of sending them through the SA-MP server. Client URL downloading is done via libcurl version 7.57.0 compiled with support for http, https, and zlib (gzip).
|
For example on
apache2 webserver you can enable/install
mod_deflate to get the files compressed automatically before they are downloaded
Re: Can we compact model files for RedirectDownload()? -
JR_Junior - 13.12.2017
Thank you!
Re: Can we compact model files for RedirectDownload()? -
JR_Junior - 13.12.2017
Sorry, but on my host I have no option to make certain files be compressed before download.
Can you explain how to do?
EDIT: I found a tutorial on internet. Thank you!
Re: Can we compact model files for RedirectDownload()? -
Zhao - 13.12.2017
Quote:
Originally Posted by JR_Junior
Sorry, but on my host I have no option to make certain files be compressed before download.
Can you explain how to do?
|
Add this to the mod_deflate config:
Code:
AddOutputFilter DEFLATE dff txd
That way .dff and .txd files will get compressed upon download.
Re: Can we compact model files for RedirectDownload()? -
Locky_ - 13.12.2017
I have a doubt. In case when redirecting the download, should I use http or https (or another protocol)?
Re: Can we compact model files for RedirectDownload()? -
Kar - 13.12.2017
Does SA-MP use http 1.1 or 1.0?
I'd like to know for nginx gzip compression settings as I'm not an apache user.
Re: Can we compact model files for RedirectDownload()? -
BlackBank - 13.12.2017
Quote:
Originally Posted by Locky_
I have a doubt. In case when redirecting the download, should I use http or https (or another protocol)?
|
If you can use https, use that one, since https is faster then http (1.x, not sure with 2.0, but most servers still use 1.x).
https://www.httpvshttps.com/
Re: Can we compact model files for RedirectDownload()? -
Locky_ - 14.12.2017
Quote:
Originally Posted by Zhao
Add this to the mod_deflate config:
Code:
AddOutputFilter DEFLATE dff txd
That way .dff and .txd files will get compressed upon download.
|
Quote:
Originally Posted by dugi
It's all in the RC thread, you can use both.
|
I'm not having success activating my compression on my Apache server. Can this value be set by .htaccess?
Re: Can we compact model files for RedirectDownload()? -
dugi - 14.12.2017
First result should answer your question:
http://lmgtfy.com/?q=mod_deflate+htaccess
Re: Can we compact model files for RedirectDownload()? -
JR_Junior - 14.12.2017
I'm using the optmization option in cpanel and is working fine with all files. Thanks!
Re: Can we compact model files for RedirectDownload()? -
JR_Junior - 17.05.2018
Quote:
Originally Posted by Zhao
Add this to the mod_deflate config:
Code:
AddOutputFilter DEFLATE dff txd
That way .dff and .txd files will get compressed upon download.
|
It is taking the same time to download the files. Is this code not working or am I doing it wrong?
PHP Code:
<IfModule mod_deflate.c>
AddOutputFilter DEFLATE dff txd
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>