Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 568 karma points
    May 17, 2017 @ 07:57
    Streety
    0

    Stop Umbraco caching on per page basis

    I have a social media "newsfeed" page similar to FB and I am getting sync errors (with my AJAX sync service) which I am attributing to the browser and Umbraco caching the nuts out of the page.

    If there a method to stop caching for just a single page?

    I think I have the sorted the AJAX calls by appending a cache-buster timestamp to the URI. Is there a method of doing the same for Umbraco?

    I know that there are meta declarations for page caching which seem to be ignored my most browsers.

    Any help gratefully received.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 17, 2017 @ 10:01
    Dave Woestenborghs
    0

    Hi Streety,

    How do you render this feed ?

    Umbraco doesn't cache page output unless you tell it to.

    Dave

  • Streety 358 posts 568 karma points
    May 17, 2017 @ 14:05
    Streety
    0

    The feed is rendered thru Angular JS. Returning to this page after a period causes some elements (server side) not to update without a F5. Additionally the update logic doesn't calculate model.length sizes correctly.

    an CTRL-F5 refreshes the page and all is well.

    I am saying is that even thou the page is reloaded, its running a cached version and not live.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 18, 2017 @ 06:45
    Dave Woestenborghs
    0

    Hi Streety,

    When you say this :

    Returning to this page after a period

    Do you mean just returning to the page without a browser refresh ? In that case it's normal that you don't see any updates in server side rendering.

    If that's not the case and Ctrl-F5 shows server updates this mean your browser is somehow dictated to cache the response of the page.

    Umbraco doesn't tell the browser to do this.

    This probably done in your code or in the webserver configuration.

    Without having a look at the code it's not possible to see what is causing this.

    Dave

  • Streety 358 posts 568 karma points
    May 30, 2017 @ 09:52
    Streety
    0

    Many thanks for your comments.

    This is an odd bug. I might be running a goose chase with the caching remark.

    It seems that when you are logged in the page works just fine. If your session stop for any reason (inactivity) and you return to the page, cookie will log you in and the sync process fails to calculate the correct length of the model array in scope. Adding new comments at this time writes the data to the DB via AJAX but the sync fails, so the new comment does not appear. Clicking F5 resets the page and re-inits scope so all works again.

    The main problem is trying to get this to fail dev side to debug the AJAX return object.

    Many thanks.

Please Sign in or register to post replies

Write your reply to:

Draft