Speed up often used Django random query <p>I've got a query set up that puts 28 random records from a database into a JSON response. This page is hit often, every few seconds, but is currently too slow for my liking.</p> <p>In the JSON response I have:</p> <ul> <li>ID's</li> <li>Usernames</li> <li>a Base64 thumbnail</li> </ul> <p>These all come from three linked tables.<br/> I'd be keen to hear of some other solutions, instead of users simply hitting a page, looking up 28 random records and spitting back the response. One idea I had:</p> <ul> <li>Have a process running that creates a cached page every 30 seconds or so with the JSON response.</li> </ul> <p>Is this a good option? If so, I'd be keen to hear how this would be done.</p> <p>Thanks again,<br/> Hope everyone is well</p>