Crazy caching question

Brass Contributor

While this references Javascript, I don't think this question necessarily belongs in the developer's area.  It's more a caching question than development.  If I'm wrong a moderator can feel free to move it.

 

For our intranet we have some custom JS code that puts what we call "charms" on the site.  They are just some pretty icons that sit in the upper left corner of the screen that are shortcuts to different destinations.  For example a little computer is a shortcut to the IS Service Desk.  They are part of the master page branding that get's pushed out to every site in the Farm.

 

The problem is that when the code was updated to change some of the charms a good percentage of users are not getting them on the screens.   Around 60-70% of the users see the old charms in IE, and around 10% of the users see the old ones in Chrome.

 

Most of you are thinking "Duh, clear your cache".  Unfortunately it's not that easy.  We have users clear their cache/wipe history and no change.  We have them do Control F5, no change.  Reboots, restarting browsers doesn't do anything either.  The users still get the old charms.  

 

We even thought it might be something on the server end, so we used hosts files to have the users point to specific WFE's, (and bypassing the load balancer), but still no luck.

 

You want to know how we fix it?  (The symptom at least).  We have a user press F12, and then reload the site and step through it.  Once it reloads the page that way then it works fine from then on for that user.   Crazy huh?  We discovered that purely by accident.  The problem is that we can't tell thousands of users around the world to do that.  (We'd get hundreds of calls to the service desk, if not thousands).  Right now the only reason no one is calling is because none of them realize that the charms are supposed to have changed.

 

Here is the code for the charms, (slightly modified to remove internal URL's)

               // Links for Top Left "Home"

               $('#suiteBar div div .ms-verticalAlignMiddle').first().prepend('<div class="SiteIcon"> \

               <a target="_parent" href="http://xyz.com/" title="Home"><i class="fa fa-home"></i></a> \

               <a target="_parent" href="http://xyz.com/en-us/resources/my-info-services/" title="Information Services"><i class="fa fa-laptop"></i></a>\

               <a target="_parent" href="http://xyz.com/en-us/news/Pages/Company-Calendar.aspx" title="Company Calendar"><i class="fa fa-calendar"></i></a> \

               <a target="_parent" href="http://xyz.com/sites/ent-search/Pages/peopleresults.aspx?" title="People Finder"><i class="fa fa-user"></i></a> \

               <a target="_parent" href="http://xyz.com/en-us/resources/globalservices/Pages/EHS-Location-Resources.aspx" title="Safety"><i class="fa fa-medkit"></i></a> \

               <a target="_parent" href="https://xyx.com etc" title="HR Connect"><i class="fa fa-users"></i></a> \

                              <div id="FavWrapper"> \

                                             <a target="_parent" href="javascript&colon;favAddLink();" title="Favorites"> \

                                             <i class="fa fa-star"></i>\

                                             </a> \

                                             <table class="FavDropdown">'+favLinks+' \

                                             </table> \

                              </div> \

                              \ </div>');

 

We been using this code for a couple years now and in the past it updated just fine.  We can't figure out why that would have changed, or any pattern between the users it's working for and the ones it's not.  For example some Win10/Edge users have the new charms, others get the old ones.  Same with Win7.  Some corporate users have new and  others the old, and some remote users have the same.  We can't come up with any kind of GPO that would have affected this.

 

We are really stuck on why the flushing the cache and the Ctrl-F5 are not working right.  The fact that it isn't working on either Chrome or IE is wierd.  At first we thought it was just an IE issue, then we started discovering some chrome users weren't updating either.

 

We are kind of stuck, and HR really wants us to get the updated charms rolled out corporate wide soon.  We are trying to think of a way to force the F12 thing to happen via a GPO or something like that that we can push to every computer, but so far we haven't figured anything out that will work.

 

Any suggestions would be GREATLY appreciated.

Ted

 

8 Replies
Is BLOBCache enabled on the Web App, and if so, is it caching JS (it will by default)?

Unfortunately no luck.  I checked both WFE's for that farm and they both say:

enabled="false"

 

At the end of the line in the config file.

 

Ted

When you run Fiddler on the client, are you seeing HTTP 304's on the content?

I hadn't run fiddler on any of the end user's machines yet.  Unfortunately that isn't an easy option as the images are pretty locked down, and I'll have to get the computer security team's permission to install that.

 

Assuming I can get that run, what would a 304 tell me if I do find it?  If I find it on a user who is seeing the old charms, but not on a user who's seeing the new ones, what would that tell me?

 

Thanks for replying.

 

Ted

 

The 304s would validate that the browser is seeing "Not Modified", even after you've modified the file.

So how would you fix something like that?

 

One of the things that has driven me nuts about this is that the clearing the browser and Ctrl F5 aren't forcing the browser to go out and grab the updated content.  In the past that has been so dependable for fixing browser related problems that having it not work is unsettling.

 

Ted

Before finding the fix, you've gotta identify what the real problem is :)

Yes, there are certain things where clearing the cache isn't always effective.

Forgot to ask, are the Publishing features enabled on the site?

Haha, yes, I'm a little anxious to get this resolved.

 

Yes, Publishing Feature is turned on for this site.

 

Ted