Fabrik / fabrik

Fabrik for Joomla 3.x
http://fabrikar.com
Other
254 stars 380 forks source link

Head script caching issue #2282

Open lscorcia opened 1 year ago

lscorcia commented 1 year ago

Hi, we are using Fabrik to display some tables on a public-facing website. We noticed that when bots come index our site, the number of sessions ballons (not a Fabrik issue), but we also noticed that those sessions tend to become larger and larger, up to several megabytes, effectively DDOSsing our session storage. We decoded a few of those session vars and we noticed that the bulk of their size is due to the Fabrik head script cache, i.e.:

https://github.com/Fabrik/fabrik/blob/master/plugins/system/fabrik/fabrik.php#L217-L251

The issue is that there is no upper bound on the number of URLs whose scripts will be cached. Ideally, one should keep just a handful of cache entries around in session, the latest 10 or 20 would be plenty, but in our codebase we easily reach 900+ URLs per session!

The problem is heavily visible when bots show up as they do not throttle their requests like a human would do and can easily submit thousands of requests in a single session.

Any idea about how to fix this problem? Thanks in advance

trob commented 1 year ago

This is Fabrik 3 for Joomla!3 which will reach its end-of-life in 3 days.

lscorcia commented 1 year ago

Yep, I know. Unfortunately we'll have to keep Joomla 3 for the foreseeable future (not my choice). Would Fabrik for J!4 be affected by this issue as of now?

trob commented 1 year ago

I can't see any code change in F4 in this case