ably / laravel-broadcaster

Official Laravel Ably Broadcaster
https://laravel.com/docs/broadcasting
Apache License 2.0
40 stars 7 forks source link

Optimize request-response time #15

Closed qsdstefan closed 1 year ago

qsdstefan commented 1 year ago
  1. Problem

    • For every client network request, Laravel used to make network request to Ably for getting server time .
    • This is due to a lack of laravel support to persist static variables across multiple requests.
  2. Solution

    • Server time diff is saved in local file cache.
    • So only on the first request, time is fetched and then reused for subsequent requests.
  3. Result

    • Reduced response time depending on latency to Ably servers.
    • In my case, it was reduced from 350ms to 150ms on page loads where Ably server time was cached.

Fixed #16

sacOO7 commented 1 year ago

We are not actually disabling them. PHP 8.1 is already incompatible with laravel 6 and 7. Just that it was working for the time being. Laravel doesn't recommend using php 8.1 with laravel version 6 and 7

sacOO7 commented 1 year ago

Any thoughts on why we need to disable some laravel/php combinations to make this work?

https://laravel.com/docs/8.x/releases#support-policy

You can see in the chart PHP 8.1 is not compatible with laravel 6 and 7

owenpearson commented 1 year ago

@sacOO7 thanks for explaining 👍 @qsdstefan fwiw it would be good to have that kind of information in the PR/commit description in future

qsdstefan commented 1 year ago

@sacOO7 thanks for explaining 👍 @qsdstefan fwiw it would be good to have that kind of information in the PR/commit description in future

Good thinking, I did not refer to the Laravel support policy when setting up the matrix for tests, which lead to the issue in the first place.