Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The choice of whether to store the information in the database or in a flat text file can be made orthogonally to the choice of whether to retrieve all the values at once or one at a time.</p> <p>That being said, you can consider the following two things:</p> <ul> <li>Retrieving them all at once, if there's a lot of data, may slow down the response of the page</li> <li>Retrieving them one at a time may slow down each item and result in many, many calls to the server</li> </ul> <p>What might be a good resolution is to group the tooltips into bunches that are likely to be accessed around the same time (ie, a group for each section of the page). Then, you can retrieve the group that has the tooltip you need and it will grab the all the ones the user is likely to need shortly thereafter.</p> <p>Another option is to retrieve the tooltips via a javascript file (rather than via ajax), and then load the file asynchronously once the page is loaded. The page will display and, while the user is first looking at it, the tooltips can be loading in the background. If I remember correctly, this will also let the browser cache the data (js file) so that the information won't need to be reloaded if the user comes back to the same page (ie, caching without you having to do any work to get it).</p> <p>As to the decision of a db vs a text file, the text file will generally be faster. However, I would make the choice based more on how/when you're likely to change the tooltips. If you're comfortable needing to push a new version of the app whenever you change a tooltip, the flat file is a reasonable (and simple) choice. If you want to be able to change tooltips dynamically (which seems unlikely), the database is probably a better choice. Either way, the choice by which you choose when to load the tooltips and how many of them will probably overshadow the difference between the database and a flat file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload