Welcome Guest, Not a member yet? Register   Sign In
CI3 Hook Compression with CI4
#1
Question 

Any way to do this https://github.com/bcit-ci/CodeIgniter/w...TML-output

with CodeIgniter 4?

I need replace 

$CI =& get_instance();
$buffer = $CI->output->get_output();
$CI->output->set_output($buffer);
$CI->output->_display();

with CI4 settings  Blush
Reply
#2

(This post was last modified: 03-23-2020, 12:21 PM by jreklund.)

Use an after filter: https://codeigniter4.github.io/userguide...er-filters

With:
CodeIgniter\HTTP\Message::getBody()
CodeIgniter\HTTP\Message::setBody()

From:
https://codeigniter4.github.io/userguide...ponse.html

Personally I just use efficient object caching (Redis) and HTTP caching (Varnish/Nginx) instead. If you don't test that enough, it can render your website unusable.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB