m-rtijn / argostime

Keep an eye on prices
https://argostime.mrtijn.nl/
GNU Affero General Public License v3.0
8 stars 3 forks source link

Fix some page load times #56

Open tweska opened 1 year ago

tweska commented 1 year ago

It takes a very long time to load the Albert Heijn page: https://argostime.mrtijn.nl/shop/1

I think we might be able to fix this using a more clever SQL query or adding indexes to the tables.

Resource on indexes: https://dev.mysql.com/doc/refman/8.0/en/mysql-indexes.html

m-rtijn commented 1 year ago

I think part of it would also be to have pagination (i.e., don't just load literally everything). Maybe another improvement could be to host the database somewhere else than a cramped VPS

m-rtijn commented 1 year ago

With the optimizations from #70, the AH overview page now takes on average about 0.8 seconds to load, where it used to take about 16 - 18 seconds. Further improvement is possible by adding memoization of current price, and maybe leveraging a cache like Redis. Although I'm not sure how much that would change if the cache runs on the same server as Argostimè and the MariaDB as is now the case for argostime.mrtijn.nl