The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Manage Number of Queries Based off Device

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #176086

    Ok, here’s a what if: you’ve got a homepage, and you want to put some news posts on it. You need:

    • 8 posts for desktop devices.
    • 5 posts for tablet devices.
    • 2 posts for handheld devices.

    It wouldn’t make sense to get all 8 articles and only use 2 of them for handheld devices. That could be a lot of extra queries and rendering time, even if you hide the unneeded parts with CSS.

    So, for the sake of speed and efficiency, how would you change the number of posts you need based off the device that is being used?


    Most straightforward way would be to get all of the posts via ajax, after the page has loaded and you can query the device.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.