Copied to clipboard

Flag this post as spam?

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


  • Damion 59 posts 261 karma points
    15 days ago
    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 290 posts 1298 karma points
    15 days ago
    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 37 posts 180 karma points
    14 days ago
    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 59 posts 261 karma points
    14 days ago
    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) 221 posts 604 karma points
    1 week ago
    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