diff options
| author | 2018-10-14 14:37:50 +0200 | |
|---|---|---|
| committer | 2018-10-14 14:37:50 +0200 | |
| commit | 5b030dcc6ff1393e29ecc6e5c76f129c7ad6c914 (patch) | |
| tree | 6f067da3d9cc3c9691053ebae6c25750c79a4eb3 /app/views | |
| parent | 1f3953715892a3944895f80c4dce559b7e4e86d4 (diff) | |
Ensure fast flush of HTTP headers and HTML head (#2045)
* Ensure fast flush of HTTP headers and HTML head
The fast flush optimisation done in
https://github.com/FreshRSS/FreshRSS/pull/1133 does not seem to work
anymore (need to check if it is related to a PHP version).
Work-around when PHP flush() is not working
Can be tested by adding a `sleep(5);` after:
https://github.com/FreshRSS/FreshRSS/blob/ee902ee7c4370421802768c3105ba269a4f97b16/app/layout/layout.phtml#L27
Follow-up of the performance checks of
https://github.com/FreshRSS/FreshRSS/pull/2040
* output_buffering in .user.ini for PHP CGI / FPM
* Reuse .user.ini for Docker PHP config
* Longer flush
Flush a bit later, to be compatible with the default value of 4096 for
PHP output_buffering, and thus avoid the need of tuning the value.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/index/global.phtml | 5 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 5 | ||||
| -rw-r--r-- | app/views/index/reader.phtml | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index 2f25b6dc2..3566abe7e 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -1,6 +1,11 @@ <?php $this->partial('nav_menu'); + flush(); + if (isset($this->callbackBeforeEntries)) { + call_user_func($this->callbackBeforeEntries, $this); + } + $class = ''; if (FreshRSS_Context::$user_conf->hide_read_feeds && FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index ac2ea812d..d5ae8e2f9 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -3,6 +3,11 @@ $this->partial('aside_feed'); $this->partial('nav_menu'); +flush(); +if (isset($this->callbackBeforeEntries)) { + call_user_func($this->callbackBeforeEntries, $this); +} + if (!empty($this->entries)) { $display_today = true; $display_yesterday = true; diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index a92767f1c..c15b936ee 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -1,6 +1,11 @@ <?php $this->partial('nav_menu'); +flush(); +if (isset($this->callbackBeforeEntries)) { + call_user_func($this->callbackBeforeEntries, $this); +} + if (!empty($this->entries)) { $lazyload = FreshRSS_Context::$user_conf->lazyload; $content_width = FreshRSS_Context::$user_conf->content_width; |
