browser cache

3826
35
Jump to solution
05-08-2012 07:38 AM
EricGardecki
Occasional Contributor
It seems like I often have to clear my browser's cache after updating some things with my web app or else the changes do not show.  Clearing the REST cache doesn't take care of everything.  I think the average user would not think to clear their cache let alone even know how and they would not see changes/fixes.  Is there a way to force it on load somehow?  If not, Any ideas on how to get people to understand that it may be necessary?  I doubt that a snippet in a help page would be enough....plus when would they even know that a change has been made and they need to clear it?

thanks!
Tags (2)
0 Kudos
35 Replies
PetraStrbenac
New Contributor III
What about Flex Viewer version 3.0?

I tried applying time-stamps to ConfigManager.as and I also tried making time-stamp changes to index.html (swfobject.embedSWF) but in case of ConfigManager.as changes, I got error #2124 (Loaded file is an unknown type.). In case of index.html modification, I got blank page.
Since I could only find modified ConfigManager.as and other suggestions for previous versions of Flex (2.3, 2.5) I was (at least I think I was) careful to apply time-stamp changes correctly. I also had to change Date().getTime to Date().time, since getTime was not recognized by Flash Builder.
In addition I tried adding the following meta-tags to index.html but non of it helped:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">.

Can anyone please help me find the solution for disabling client-side caching for Flex Viewer 3.0 application? It is really annoying that I have to clear the cache in order to reflect even minor changes to my application. Even bigger problem is that I have to periodically make changes to the application so returning users experience problems with loading the new version of the application (since the previous version is already cached on their side).

Any help or suggestion would be greatly appreciated!

Petra
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Petra,

   Sure here is all the code changes in these posts consolidated. There are three file that need changing. All changes are commented in the source files.
0 Kudos
PetraStrbenac
New Contributor III
Robert, thank you very much for your effort! I replaced the default files with the ones you prepared, compiled the app and everything is working fine now, with no client-side caching :).
Petra
0 Kudos
jamesdiaz
New Contributor
Robert, would you happen to have a 3.1 compiled version?
0 Kudos
jamesdiaz
New Contributor
anyone????
thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

   A compiled version would really mean a whole Flex Viewer compiled project and I don't get involved in doing that. This is something that if you want this capability then you will need to be using the source code (not the compiled viewer).
0 Kudos
jamesdiaz
New Contributor
James,

   A compiled version would really mean a whole Flex Viewer compiled project and I don't get involved in doing that. This is something that if you want this capability then you will need to be using the source code (not the compiled viewer).


Robert,
thanks for your reply, I will take the same you provided on post #22 but for 3.1.

thanks
0 Kudos
JasonStanton__GISP
Occasional Contributor
I incorporated the 3.0 files into my 3.1 application.  It prevents the caching but layers are not showing up in my TOC widget, which causes issues opening all other widgets.  Does anyone have any thoughts?
0 Kudos
EricGardecki
Occasional Contributor
First I'd just like to say that this is a huge PITA to deal with every time I change versions (i just reverted back to 3.1 actually), especially since that ConfigManager changes slightly apparently and I'm not sure if I'm editing it correctly based on the file Robert posted above.....so I really wish that this would just be incorporated in the the viewer by ESRI as it seems like an absolute necessity to me.

I'm not sure if the issue you are seeing is what I've just noticed myself.  One of my users is having an issue where (when using IE only) the widgets do not load as they seem to hang as they wait for the TOC to load.  IF this is the same issue as you are experiencing, note that this is only (afaik) happening to this one user on my end so I believe it is an issue with IE or flash player on that machine.  Check to see if the same thing happens on another browser or machine.

If that is not the case for you, I can offer you my edited ConfigManager.as for 3.1 to add in your project and see if that helps.
0 Kudos
JasonStanton__GISP
Occasional Contributor
Thank you so much for the quick reply.  I am having the issue in Firefox.  I would love to try your version and see if it helps, thanks!
0 Kudos