Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Damion 96 posts 331 karma points
    Sep 09, 2019 @ 11:28
    Damion
    0

    cached partial causing problem after search results returned

    I've taken over development of an Umbraco 8 application and have run into the following problem:

    All partial views are rendered as CachedParial with a time of 60 secs.

    If I do a search using the searchbar we have, the results are returned ok, but when I try to click away to any other page in the app, the search page remains for that 60 secs, after which I can click to home or where ever.

    What's best to do here, use partial instead of CachedPartial for the container holding the search results and the search bar?

    thanks

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Sep 09, 2019 @ 12:03
    Shaishav Karnani from digitallymedia.com
    100

    Hi Damion,

    Yes you answered your question. You can use Partial instead of Cached Partial for Search.

    Cheers,

    Shaishav

  • Carlos Gomes 38 posts 184 karma points
    Sep 09, 2019 @ 22:09
    Carlos Gomes
    0

    Hi Damion,

    That's weird, at our company we are using CahedPartials too and we do not have that issue. Can you please provide more details about your implementation?

    Thanks,

  • Damion 96 posts 331 karma points
    Sep 10, 2019 @ 08:29
    Damion
    0

    Hi Carlos,

    I think the problem (now resolved, but I dont like how I resolved it) is this:

    The main home page contains several partials, including a top nav bar with a search, and a central container which changes depending on the content.

    When you enter search criteria and click a button, the container is updated and shows the search results.

    But as the main page contains all cached partials set at a time of 60 seconds, if I then click a 'home' button or try another search (bear in mind all this would happen on the one page), the cached partials are reloaded showing the last search criteria and results, this will happen for the next 60 seconds.

    I got round it by setting the cache time in webconfig to 0, but I'm not happy with that, I'm guessing there is a way to reload the entire page and reset the cached partials within it?

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Sep 10, 2019 @ 14:21
    Paul Wright (suedeapple)
    0

    You can vary the cache, by a query string parameter.

    It's just an additional attribute you can set on Cached Partials.

Please Sign in or register to post replies

Write your reply to:

Draft