aaroncox / chainbb

chainBB backend services and api
https://chainbb.com
MIT License
52 stars 36 forks source link

Cache main forums page. #54

Closed syvb closed 6 years ago

syvb commented 6 years ago

Caches the main page JSON data for 30 minutes.

aaroncox commented 6 years ago

This would also cache the "Last Reply" in that forum for 30 minutes as well, which wouldn't be all that desirable.

image

What was the reason behind caching that data? The query itself doesn't take all that long to execute.

syvb commented 6 years ago

The main page seems especially slow for me.

aaroncox commented 6 years ago

I've noticed that too and I think it's actually the browser inefficiently rendering all ~150 forums. The response itself is also pretty large (175kb), but generally returns in under 400ms, half of which is the actual transfer of the data.

I don't think caching this request like this is going to do much in terms of performance. It's actually already cached to some degree in a microcache via nginx (which has a lifespan of a few seconds), and if caching it longer would be beneficial, nginx would probably be the place to do it.

A few other things that could improve the responsiveness would be:

In the end though, I don't think this "All Forums" page will exist forever, so I'm not sure what kind of effort should go into working on it. It wouldn't be all that useful of a page after chainBB has 1k or 100k forums. Really a different "forum browser" interface needs to be created, that lets you search, categorize and share forums. That's where I envision the interface heading.

I'm going to close this pull request, but I do appreciate your contributions to the project.