Advice: Articles loading



  • Hi,

    I need some advice regarding an app I’m building.

    So the app basically has pages, when you navigate to these pages, it does a call to an remote server that sends back data. This data is generated HTML with an image and some text.

    The problem is sometimes there’s a lot of articles that get sent back and it takes some time to load.
    What would be my best approach to reduce load time of these pages ?

    I currently show a loader while the call is taking place.

    Should I load the articles on app load and store them in a global variable or localStorage ? Any advice would be great!

    Thanks!



  • @Riaz Since the pages are HTML, do they take the same amount of time to load in the web browser or just longer when in the app?



  • @munsterlander … So the API that I was calling did change… it now sends back a JSON object that looks likes:

    {
    title: "My Title",
    img: "http://www.domain.com/image.jpg"
    }
    

    After calling the API the images need to load on the app and that takes a while to fully load, how can I cache this ?



  • @Riaz Same kind of question. That image, does it load only slow in the app or is it the same speed of the browser? If it is the same speed, then all you can do is preload images so they are available when the user views that page. This would require preloading all those pages.



  • @munsterlander the browser is faster, the app takes longer to load the image from an external source.

    So should I fetch all those pages and store them locally ? is it possible to store the images locally so I never have to fetch them from the remote server the entire time ?

    How would I do this ?



  • @Riaz Interesting. So you can do all that you are talking about, I guess the big question is when do you want to do that and do the articles update?


Log in to reply