I have a website that displays a list of articles, as well as category filters. Filters can be turned on and off, and the list of articles will automatically change.
I currently have this, so when I click on filters, AJAX makes a request to a script that queries the database based on the selected filters, then the results are displayed to the user.
Is this an inefficient method? Another idea I recently got was to simply query the database for EVERY article once when the page loads. Then, instead of making AJAX requests, the filters will switch accordingly with the display element of each message.
This sounds a lot better than using AJAX, but I wanted to get other opinions on the method of efficiency and semantics.
source share