Lazy load/Pagination issue

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by Raghavendra Raghavendra 2 weeks, 4 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28251
    Olivier Langlois
    Olivier Langlois
    Participant
    Post count: 7

    after entering a post page, if you return back to the blog posts list page by clicking the back button, the list reset to its initial display setup.

    Imagine someone reading the posts from top to bottom. This is going to be annoying when they reach page X, to have to press X times on the ‘Load More’ button to read the next post.

    Is there any way that a user could retrieve the last list state when he returns to the list page when clicking on the back button?

    To see what I mean, here is the list page:
    https://olivierhealthtips.com/blog-posts/

    Just click 3-4 times on the ‘Load More’ button, enter a post and click on browser ‘back’ button.

    #28276
    Raghavendra
    Raghavendra
    Moderator
    Post count: 3993

    Why not use the option to open the link to post in new window. I would use it all the time if I expect my users to come back to original page.

    #28292
    Olivier Langlois
    Olivier Langlois
    Participant
    Post count: 7

    Hi Raghavendra,

    My WP designer suggested me exactly the same solution…

    I’m not sure that I like the option to open a new tab. I feel like it could be messy. The ‘open a new tab’ solution has a ‘spammy’ feel to it. A visitor could end up with dozens of tabs open by our site. There is no website that I like that does that… I think that this has the potential to annoy people.

    Do you have examples of websites doing it that way so I can change my feelings about the idea? that seems unusual…

    Like if I go on Youtube and browse a very long AJAX video list, scroll down a bit, click on a video and click the ‘back’ button, I will return on the video list exactly as I left it.

    it is as if your js code reset its state without discerning if it is a fresh load or a load back…

    #28343
    Raghavendra
    Raghavendra
    Moderator
    Post count: 3993

    Thanks for your feedback. It’s really tough to implement the functionality you are describing. We will probably need to update the URL on each load and then when the user hours the back button, we need to reload pages of posts in one go based on the URL thathat needs to be populated. Better option and more intuitive would be to open the post in a pop-up window of some kind and when the user hits the back button, you go back to the parent window. Basically we need to load the post window using AJAX as well just like we load pages of posts archives. May be you have better ideas -I am just thinking loud here. Can be done but can take time.

    #28364
    Olivier Langlois
    Olivier Langlois
    Participant
    Post count: 7

    Ok, I get what you say about being tough to do.

    I didn’t realize that when you press back, the page is automatically reloaded from scratch because of the page cache-control is set to no-cache.

    I’m not really a WP dev so feel free to educate me. Where does the no-cache comes from? Is this built-in directly into WP or this come from WPBakery Page Builder?

    I’ll probably live with the current behavior for now as I feel that going to the popup would be like replacing an annoyance by another annoyance….

    #28373
    Raghavendra
    Raghavendra
    Moderator
    Post count: 3993

    The cache control headers come from WordPress itself although some plugins can modify the same. The browsers do a good job of caching the page and loading the same when you hit the back button. But it cannot load the content that was triggered by AJAX based server calls unless the plugin or theme repeats the call to repopulate the content. Having the URL updated on each click of load more button will help retrieve the last state by parsing the URL content in Javascript. It would not not work if you had multiple grids in the page though.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.