dyreschlock / schlock-website

Personal Website code to be run locally or generate a static website hosted through github pages.
http://theschlock.com/
0 stars 0 forks source link

Raid Counters : Add separate process to cache raid calculations #101

Open dyreschlock opened 11 months ago

dyreschlock commented 11 months ago

When the raid pages are generated, all of the calculations are generated at the same time. This takes a long time, but the page is only ever accessed once when the site is generated. This isn't the case anymore with subpages (#97). All calculations are now run twice, which adds more time for site generation.

If the data in the background doesn't change, then the results from calculations aren't going to change either. All of the results could be stored somewhere, and pages could just look at that data when they want to display it.

So, we want to do 2 things.

  1. Write a process for the Regeneration page that will load the data from the database and make all of the calculations for each raid boss. And then, store this information. Storing as JSON might be best? Do not store in the database.

  2. Rewrite the underlying process from the pages to use this data. If the data doesn't exist, then it could call the process to create it.

dyreschlock commented 11 months ago

This process also allows pages to do more calculations that could take a long time, such as which specific move sets hit harder than others.