Alternative to requiring users clear their browser cache

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Alternative to requiring users clear their browser cache

Post by chad1023 »

We deploy a WebHelp help system to our end users. Currently, it seems that the only way end users can see new topics added to the TOC is if they clear their browser cache. Is there an alternative to this? We do not wish to require users to clear their browser's cache every time an updated help system is deployed.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

Yes, you can modify the header of the pages setting the expiration date to the past or zero as well as specifying the cache control properties. See here: http://stackoverflow.com/questions/4954 ... l-browsers
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Re: Alternative to requiring users clear their browser cache

Post by chad1023 »

Is there a setting within Flare that can achieve this? Manually adding code to the headers of HTML pages doesn't seem like an ideal solution.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

Not that I know of. Typically, caching is intended behavior. As the linked page shows, there is a way to disable caching from within the Apache .htaccess file. Here is a link on how to do this through IIS http://forums.iis.net/t/1175971.aspx
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Re: Alternative to requiring users clear their browser cache

Post by chad1023 »

Is it just the TOC file that I need to prevent from caching? If so, can you tell me where in the Flare output I can find the file that I need to prevent from caching?
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

I don't think it is just the ToC. First candidate for me would be default file that loads the rest of the help. When I recall correctly, those are stored here
C:\Program Files (x86)\MadCap Software\MadCap Flare V9\Flare.app\Resources\WebHelp
Before you make changes to these files, make a backup so that you can put back the original files in case something does not work out. Also, editing these files will impact all projects.
As for each topic, you should be able to add the changes to the header to the master page and get it added into each topic.
Also, this is theory, I never tried this out because I never got into that situation with WebHelp yet. But if I had to fix this, the above would be my approach.
roboHAL
Sr. Propeller Head
Posts: 254
Joined: Mon Dec 31, 2012 9:57 am

Re: Alternative to requiring users clear their browser cache

Post by roboHAL »

The no cache code can be added to a master page. In so doing you add the code once and it is applied to all topics in the project.

<head>
<META http-equiv="Cache-Control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />
</head>
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Re: Alternative to requiring users clear their browser cache

Post by chad1023 »

This doesn't seem to be working. But I'm not certain I'm adding the cache code to the master page correctly.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

It needs to be part of the head section, not the body. The position in the head section should be irrelevant. Do you see these entries in the generated output files? Also, you will need to clear the browser cache one more time because the browser still thinks it has a valid cached copy of the file. After that you should be fine.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Alternative to requiring users clear their browser cache

Post by NorthEast »

Note that adding this to the master page will only include it in topics - it's not going to affect the TOC, which was the issue mentioned.

Presumably if you want to use this technique to update the TOC, the meta tags need to be in the main help file.

Flare v10 allows you to add meta tags to the main help file (via the target).
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Re: Alternative to requiring users clear their browser cache

Post by chad1023 »

You are using terms that I'm not sure what you mean. What do you mean by "head section" and "main help file."
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

By "head section" I meant the portion of the HTML between the <head> tags.
Can't speak for Dave here, but I assume he means the file that you specify in CHS calls as the 'base' file. I think it is called default_CSH.htm if you did not specify a different name. That file will load in all the other components of the help.

If you have a need to directly access topic files then the master page will also need these entries.
chad1023
Jr. Propeller Head
Posts: 6
Joined: Thu Feb 27, 2014 10:02 am

Re: Alternative to requiring users clear their browser cache

Post by chad1023 »

So I've added the code below between the <head> of the master page, the /output/mywebhelp/default_csh.htm file, and the output/mywebhelp/skin/toc.htm file. I still have to clear my browser cache in order to see any updates made to the TOC.

<META http-equiv="Cache-Control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />
Johanna
Propeller Head
Posts: 25
Joined: Wed Feb 25, 2015 3:08 am

Re: Alternative to requiring users clear their browser cache

Post by Johanna »

I have the same question.
Did you find an answer in the meanwhile? I would be much interested.
smajors
Sr. Propeller Head
Posts: 180
Joined: Mon Oct 21, 2013 9:28 am
Location: Midwest United States

Re: Alternative to requiring users clear their browser cache

Post by smajors »

I don't see a head tag in the skin html, do you add one?
Technical Writer
Training & Development Team/Marketing Department
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Alternative to requiring users clear their browser cache

Post by NorthEast »

You can add meta tags to the output via the target.

See the help here:
http://webhelp.madcapsoftware.com/flare ... a_Tags.htm
jknasinski
Propeller Head
Posts: 36
Joined: Tue Jul 10, 2012 9:31 am
Location: Milwaukee Wisconsin

Re: Alternative to requiring users clear their browser cache

Post by jknasinski »

There are a couple of ways to fix it. It the target in Flare in the Advanced tab you can add meta tags such as:
<META http-equiv="Cache-Control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />

My dev team looked at that and said it would work but didn't want to test each browser so they came up with a web.config file that they are adding to the help deployment that prevents caching in IIS. That works fine. We just include the small web.config file in the same folder that they deploy the help files to.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

Can you share what the entries in web.config are to prevent client side caching? Thanks in advance!
jknasinski
Propeller Head
Posts: 36
Joined: Tue Jul 10, 2012 9:31 am
Location: Milwaukee Wisconsin

Re: Alternative to requiring users clear their browser cache

Post by jknasinski »

The web.config file my dev team created is:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
</configuration>
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

Thank you very much for posting this.
smajors
Sr. Propeller Head
Posts: 180
Joined: Mon Oct 21, 2013 9:28 am
Location: Midwest United States

Re: Alternative to requiring users clear their browser cache

Post by smajors »

jknasinski wrote:There are a couple of ways to fix it. It the target in Flare in the Advanced tab you can add meta tags such as:
<META http-equiv="Cache-Control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Expires" CONTENT="-1" />
Do you need to separate these by commas? I added the meta tags to the Target but now is showing in the head of my default file in the output. I removed the tags from the head in the default file itself and that didn't seem to remove it so wondering where this output is coming from.
meta.jpg
meta_head.jpg
You do not have the required permissions to view the files attached to this post.
Technical Writer
Training & Development Team/Marketing Department
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Alternative to requiring users clear their browser cache

Post by RamonS »

The lines are within the <body> tag of your page, that is why they show in the output. The entries need to go into the <head> section of the file, not to be confused with the header of a master page which is part of the <body>.
Post Reply