Open askvortsov1 opened 3 years ago
It's supposed to be cached though
Is it not working as intended then?
Maybe Laravel is doing some magic to re-fetch the resources from the database when unserializing? Maybe this should be cast to array before caching?
Regardless of how it's loaded / cached, large text shouldn't always be included in the payload because it increases transmission and TTFB size unnecessarily: https://discuss.flarum.org/d/26419-help-with-a-3-million-users-flarum/14
Is there a place I can see that 1MB JSON payload? That's surprising. Did they copy their full conditions inside of the terms update message?
If you just include a short message in the update notes and don't have tens of different terms, there's no way to reach that big of a payload. I just checked and everything appears to be properly serialized and there's no extra data that shouldn't be in the boot payload.
Those observations are on the latest version. If there's a problem with the beta 13 version, we'll only consider patches as paid work.
https://github.com/FriendsOfFlarum/terms/blob/master/extend.php#L77-L85 means that the full terms are included with initial request payload, always. There isn't really a need for this, and it can cause significant issues