It took me a few days to research how we can speed up flarum, and what happened to me i ended up disconnecting cloudflare for good! I am now using my host servers and i can smile again. I don't know what's wrong with cdn with my site. It somehow just started to slow down my website. Google reported failing urls, so my host told me to stop the cdn.
On Google Insights Speed
Without ads i get 0.8 speed index desktop and mobile 3.5 secs
On Gtmetrix
i have B and LCP 2.1
(that's the reason i quit cdn, its not made for me 😅 )
Continuing with my research i found this code which makes color paint and speeds all green! Imagine without cdn but green and grade A's, sounds good to be true
But again, this code despite its wonders, users may not be able to login. If any flarum member has the knowledge to make this one work or applicable to flarum, we will accomplish speed issues. Another chapter closed 👏
RewriteCond and RewriteRule if it can be corrected.
<IfModule LiteSpeed>
RewriteEngine On
CacheEnable public /
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Mobile|Opera Mini|Fennec|Windows Phone"
RewriteRule .* - [E=Cache-Control:vary=ismobile]
RewriteCond %{REQUEST_METHOD} ^HEAD|PURGE|GET$
RewriteCond %{ORG_REQ_URI} !/news
RewriteCond %{ORG_REQ_URI} !/admincp
RewriteRule .* - [E=Cache-Control:max-age=120]
</IfModule>