Closed kenny-lfx closed 1 month ago
Hi guys, I reviewed your ADR and did some research on cacheing the footnotes myself. Here are my thoughts:
Good
Good focus on performance: The local caching solution does a great job of improving page load times without making things too complicated. It avoids the hassle of persistent storage and still speeds things up.
Works well with the current system: This approach fits smoothly into the existing setup, so we don’t have to make big changes to how footnotes work. It's a smart upgrade without much disruption.
Bad
I like this idea because it addresses a concern that we noticed while finding the tool pain points. However, like you mentioned, it will be super effective for docs with large no. of footnotes, not very noticeable in the regular usecase. Given the time limit of 2 days, I'm not sure if we can achieve this, Browser based caching seems simpler to implement, not ideal though
Lazy loading and Virtual DOM could be another approach for improving performance.
The idea of improving footnote caching seems good! Implementing caching, we can have separate client side and server side cachcing in CoffeeScript
Closing this issue - unable to implement within given time frame / unclear implementation procedure.
Implement Footnote Caching for Improved Performance
Context and Problem Statement
BigFoot.js dynamically generates and manages footnotes in real-time whenever a user interacts with a page. While this approach ensures that footnotes are always up-to-date, it can lead to unnecessary recomputation and performance overhead, especially for pages with a large number of footnotes or complex content. To improve performance, we need a way to reduce redundant footnote processing by caching footnote data.
Decision Drivers
Considered Options
Decision Outcome
Chosen option: "Implement local caching of footnote data," because it offers a balanced approach to improving performance without relying heavily on browser storage or disrupting the current dynamic footnote generation. This method can store footnote data in memory for the duration of the page session, reducing the need for repeated calculations.
Consequences
Confirmation
This decision will be confirmed through performance benchmarking before and after the implementation. Testing will focus on pages with varying footnote quantities to ensure caching improves both the perceived and actual performance. Memory profiling will ensure there are no memory leaks or excessive memory usage from the cache.
Pros and Cons of Other Options
Use browser-based caching (localStorage or sessionStorage)
Keep the current implementation without caching