Welcome Guest, Not a member yet? Register   Sign In
CI 4 Output Compression
#6

In your Controller you can call for negotiator service to set gzip encoding.
PHP Code:
service('negotiator')->encoding(['gzip']); 

In your public/.htaccess you may define other resources by file-extension to be gzip encoded by apache.
Code:
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|html|htm|php|json|xml|jpg|jpeg|gif|raw)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

For apache gzip encoding to work: make sure you have this line uncommented in your apache/conf/httpd.conf
Code:
LoadModule deflate_module modules/mod_deflate.so

Let me know if it worked for you Smile
Reply


Messages In This Thread
CI 4 Output Compression - by [email protected] - 06-18-2021, 07:23 AM
RE: CI 4 Output Compression - by InsiteFX - 06-19-2021, 12:51 AM
RE: CI 4 Output Compression - by InsiteFX - 06-19-2021, 09:02 PM
RE: CI 4 Output Compression - by stopz - 09-02-2021, 12:19 AM
RE: CI 4 Output Compression - by nc03061981 - 12-10-2021, 08:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB