Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Dec 31, 2010 @ 17:41
    Tim
    0

    Base and IE Caching

    Hi,

    How do you guys deal with IE caching /base responses? Using the JQuery cache buster stuff fails cos it messes with the URL, currently I just have a spurious parameter (ieSucks) that has a random number in to get round the problem. Is there a better way to do this?

    Cheers,

    Tim.

  • jc 64 posts 101 karma points
    Dec 31, 2010 @ 20:48
    jc
    0

    Can you try something like this in your /Base method?

    using System;
    using System.Web;

    namespace BaseTest
    {
        public class TestClass
        {
            public static string GetCurrentTime()
            {
                HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                return string.Format("Current time: {0:MM/dd/yy H:mm:ss zzz}", DateTime.Now);
            }
        }
    }

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 01, 2011 @ 13:24
    Jan Skovgaard
    0

    Hi Tim

    Passing a random numer in a querystring as you're already doing is a very comon approach. What jc is suggesting looks really interesting though and if it works it would be a more pretty solution.

    /Jan

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Jan 08, 2011 @ 11:17
    Tim
    0

    @jc, I tried various permutations of that (I tried some of the other caching options too), with no luck, IE still cached it. I'm not sure if it's because the call is wrapped in the /Base methods or not, I need to debug it when I have more time!

    For now I've stick with passing in a spurious timestamp to the methods so that they work ok, although I'm definately going to investigate this one further as it's a much neater way of doing it. Also, it amuses me to have a parameter called "fixIE".

    :P

Please Sign in or register to post replies

Write your reply to:

Draft