Force Reload of TOC after publishing new content

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
le_sloth
Propeller Head
Posts: 21
Joined: Sun May 20, 2007 11:16 pm

Force Reload of TOC after publishing new content

Post by le_sloth »

Hi

When I publish updated content to my WebHelp project (in which I've added/reorganised some of the TOC), the TOC doesn't get refreshed i.e. still shows the old content. Is there a way to force this to reload? Seems to be more of a problem in FireFox and Chrome than IE.

BTW, I don't mean using This Frame > Reload Frame - need something to happen automatically as don't want to have to tell our end-users to do this each time we publish something.

thanks

Richard
---
Using Flare 7.0
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Force Reload of TOC after publishing new content

Post by LTinker68 »

Browsers by default will load content from the cache if they see you're going to the same site, unless the page has server-side code that runs, like .asp and .aspx, in which case it would reload the entire page. Some browsers allow you to override the default behavior, but it's something that has to be modified in the browser, so it's on a user-by-user basis. I believe there is JavaScript code you can insert into a page that forces the page to be loaded entirely and not from the cache, but you'd have to do some research to find the code.

Long story short, it's a browser thing not a Flare thing, although you could certainly submit a feature request at http://www.madcapsoftware.com/bugs/submit.aspx asking them to add an option that when enabled would automatically insert the appropriate JavaScript code to force a full page load.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Force Reload of TOC after publishing new content

Post by RamonS »

You don't need slow JavaScript for that. It is a matter of setting proper expiration dates in the headers of the HTML files. Ideally, those are configurable from always expire (setting it to a date that is always in the past) or any other specific or relative date. That is what the HTTP cache-control directive and the Expires HTTP header field are for.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Force Reload of TOC after publishing new content

Post by LTinker68 »

There you go. It would be easy enough to add those types of field declarations in the masterpage, or maybe just in the "welcome" page, but if you use CSH then the users might not always go to the welcome page, so the masterpage might be better. Although I'm not sure if putting it in the masterpage would force only the topic to be loaded or if it would force the whole website and therefore the TOC pane, too. RamonS, do you know how those headers work when they're in a topic in a frameset? Do the headers need to be added to the frameset file instead? (Hopefully not, since that would require a manual modification of the frameset files after every build or a modification of the files in the program files folder.)
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Force Reload of TOC after publishing new content

Post by RamonS »

I'd assume that putting them into the document that gets loaded into the frameset is enough, but that requires to also add it to the ToC frame. The topics alone are probably not enough. There are also some other tricks one can pull. I use it in a web application...would need to dig up the code. My approach is probably over the top as I took every means of expiring a page and put it in there. This is what I do when I have no real clue about what I am doing. Nevertheless, the cache and expiration settings in the header are straight forward and documented in the HTTP spec here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
See sections 14.9 and 14.21.
le_sloth
Propeller Head
Posts: 21
Joined: Sun May 20, 2007 11:16 pm

Re: Force Reload of TOC after publishing new content

Post by le_sloth »

OK, thanks for the replies - I vaguely understand.

It's only the TOC that needs refreshing each time new content is loaded, so any header should go in the /Skin/Toc.htm file - is that right?

Say I want this to stay in the cache for 24 hours max, what header do I need to set?

thanks
---
Using Flare 7.0
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Force Reload of TOC after publishing new content

Post by lacastle »

Did this ever get fixed? I have the same problem with my TOC not reloading when i publish to a web server.
MinnesotaCory
Propeller Head
Posts: 30
Joined: Tue Jan 25, 2011 3:40 pm
Location: Marshall, MN

Re: Force Reload of TOC after publishing new content

Post by MinnesotaCory »

This is what I have in my MasterPage(s) to force a reload every 5 minutes and prevent caching. I did some digging and I think I found this on http://www.w3schools.com

Code: Select all

    <head>
		<meta http-equiv="refresh" content="600" />
		<meta http-equiv="pragma" content="no-cache" />
    </head>
-CK
If you plan to communicate you must prepare to be misunderstood or ignored.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Force Reload of TOC after publishing new content

Post by lacastle »

MinnesotaCory wrote:This is what I have in my MasterPage(s) to force a reload every 5 minutes and prevent caching. I did some digging and I think I found this on http://www.w3schools.com

Code: Select all

    <head>
		<meta http-equiv="refresh" content="600" />
		<meta http-equiv="pragma" content="no-cache" />
    </head>
-CK
Thanks, but this did not force my TOC to reload without the existing cache. where do i add the no-cache code for that?
MinnesotaCory
Propeller Head
Posts: 30
Joined: Tue Jan 25, 2011 3:40 pm
Location: Marshall, MN

Re: Force Reload of TOC after publishing new content

Post by MinnesotaCory »

For me it forces a reload of the whole frameset. I do remember having problems with browsers that were already running on a cached copy after I added the code. After re-starting the browser it reloads the whole frameset every 5 minutes.
If you plan to communicate you must prepare to be misunderstood or ignored.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Force Reload of TOC after publishing new content

Post by lacastle »

Searching through the Output/Data files led me to Toc.xml, which looks like it's not being refreshed in the browser. The correct Toc.xml is loaded on the server, but isn't refreshing. I just manually opened http://..../Data/Toc.xml and pressed F5 to refresh the screen. When I went back to webhelp.htm, the TOC was updated.

Now, how do I get Toc.xml to refresh automatically?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Force Reload of TOC after publishing new content

Post by LTinker68 »

Toc.xml is called by Toc.htm, I think, so you should be able to put that same code into that file, although you'll have to do it every time you do a rebuild.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Force Reload of TOC after publishing new content

Post by lacastle »

Adding the meta tags to Toc.htm did not work to refresh Toc.xml.
Now I'm looking for some sort of inline refresh code (javascript?) that i can add to the Toc.xml call, since technically the xml page doesn't have a <head> where I can add a meta tag.

Does everyone else not have this problem with the TOC not updating automatically? I don't know what makes my current project different from other ones, or what makes my current browser want to save the cache version.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Force Reload of TOC after publishing new content

Post by LTinker68 »

Most of my projects are print, not WebHelp, and when it's been in WebHelp it's been when it's run from the local computer, not a web server. So it was only recently I noticed the problem -- I don't know if it's always been there. It seems to be more noticeable in Firefox than IE, oddly enough. I can't remember if I noticed it in Chrome.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
lacastle
Propellus Maximus
Posts: 1028
Joined: Thu Apr 12, 2007 7:28 am
Location: Wilmington, DE
Contact:

Re: Force Reload of TOC after publishing new content

Post by lacastle »

I have no idea what [finally] happened, but my TOC is fine now. And I've tested it 3 times with little changes uploading to the server. (But I'm still holding my breath for it to keep working.)
To recap what I did:
-added meta refresh tags to my masterpage (to go on all my content pages)
-do not add meta refresh tags to Toc.htm (I tried it 1x but didn't notice a difference, and never edited it post-processing again)
LTinker68 wrote:It seems to be more noticeable in Firefox than IE, oddly enough. I can't remember if I noticed it in Chrome.
My webhelp works fine in Firefox and IE8. I don't have Chrome to test.
Pannonian
Propeller Head
Posts: 20
Joined: Tue Jan 11, 2011 2:53 am
Location: Vienna, Austria
Contact:

Re: Force Reload of TOC after publishing new content

Post by Pannonian »

just adding this tag to the masterpage didn't help.

Is there any workaround for the not-reloading problem? (tbh it is getting on my nerves to say 50 people in our company to clear their cache every 3 days...)
JeremyTaylor
Jr. Propeller Head
Posts: 6
Joined: Tue Apr 28, 2015 3:00 am

Re: Force Reload of TOC after publishing new content

Post by JeremyTaylor »

Add the meta tags
<meta http-equiv="refresh" content="600" />
<meta http-equiv="pragma" content="no-cache" />
or similar in the Advanced tab in the target - look for the Add meta tags to content: field
Fiona
Sr. Propeller Head
Posts: 117
Joined: Tue Jan 27, 2015 7:44 am
Location: U.K.

Re: Force Reload of TOC after publishing new content

Post by Fiona »

Just come across this issue...I'm using Flare 12, HTML5 help and viewing it on Firefox. I'll try adding the metatags and see if that sorts it...
Fiona
Sr. Propeller Head
Posts: 117
Joined: Tue Jan 27, 2015 7:44 am
Location: U.K.

Re: Force Reload of TOC after publishing new content

Post by Fiona »

Be careful – I added the suggested metatags and am now having an issue reported whereby if you leave a page open and come back to it later it resets to the defined first page...not ideal! Removing the "refresh" metatag stops this from happening.
mjpitman
Jr. Propeller Head
Posts: 3
Joined: Thu Oct 18, 2018 6:41 am

Re: Force Reload of TOC after publishing new content

Post by mjpitman »

I've encountered this problem recently myself, so I've submitted a support call to MadCap to see what their suggested (preferably low-impact) resolution is. I'll let you know what they say.
JRtechw
Propeller Head
Posts: 68
Joined: Thu Oct 05, 2017 8:08 pm

Re: Force Reload of TOC after publishing new content

Post by JRtechw »

Static header cache directives are not compliant with HTML5. Those two meta tags (refresh and pragma) will be ignored by up-to-date browsers. You have to set the caching directive in the HTML response header sent from your web server. I imagine that there is nothing that MadCap can do on the Flare side to implement any caching.

How to do this will depend on your web server: IIS, Apache, etc. Look up the doco for your web server and talk to your environment's sys admin for more information on setting caching.

For example, we use IIS in an Azure storage environment. I use web.config files to set caching at various levels: all CSS, skin, and TOC folders are set to never cache, whereas most other reasonably non-volatile content is set to refetch after five days.

Bear in mind that if you want to set items like TOCs and Skins to always fetch, you will have to manually copy config files (if that's your solution) to those folders in your destination *after* publishing, or add a post-build command in the Target > Build Events tab to copy over. I can't speak for other config files, but web.config files on Azure propagate caching down to child folders (i.e. you only need to add a file to the top folder, and files in all subfolders will inherit the caching set in that config file).

Config files aren't the only way. IIRC, there is an option on the IIS configuration dashboard to add lines to the response headers. But web.config suits Azure better.

I'm no expert at all, but I can try to rustle up more examples and info if you need.
Post Reply