Prevent WebHelp Caching in Browser.
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 7
- Joined: Thu Mar 13, 2014 4:23 pm
Prevent WebHelp Caching in Browser.
Hey folks,
Is there a way to prevent browsers from caching webhelp?
I had a situation where someone requested a change to topic content and could not see the updates until they refreshed the browser. Easy fix in this instance, but I want to eliminate the possibility of my readers using stale cached content when updates are available.
Thanks!!
Is there a way to prevent browsers from caching webhelp?
I had a situation where someone requested a change to topic content and could not see the updates until they refreshed the browser. Easy fix in this instance, but I want to eliminate the possibility of my readers using stale cached content when updates are available.
Thanks!!
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Prevent WebHelp Caching in Browser.
Post by sorin_ristache »
Hello,
You can add meta instructions in every Webhelp page that disables the browser cache policy. It seems the following two header instructions added in a web page disables the cache policy in recent versions of all browsers:
You should add these two lines:
Regards,
Sorin
You can add meta instructions in every Webhelp page that disables the browser cache policy. It seems the following two header instructions added in a web page disables the cache policy in recent versions of all browsers:
Code: Select all
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
- in the "jsAndCSS" template from file:
[Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\dita\desktop\common.xsl
following the line:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- in the "create-toc-common-file" template from file:
[Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\createMainFiles.xsl
following the lines:
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
Regards,
Sorin
-
- Posts: 110
- Joined: Fri May 14, 2010 12:14 am
Re: Prevent WebHelp Caching in Browser.
I just ran into this myself yesterday. I posted a new version of content and authors were looking for the changes that they had made and couldn't see them. Holding down the shift-key and doing a refresh brought in the new version, so the old version was cached in the browser. I wanted to see if there was a way to do this from Apache rather than edit the transform assets, and I came upon something like the following that can be placed in the .htaccess file for the WebHelp root directory:
I like the option of specifying a pattern to match against in case different caching strategies are needed. I'll try this in a couple days. If there's some reason why this is a bad idea, I'm all ears.
Code: Select all
<filesMatch "\.(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Prevent WebHelp Caching in Browser.
Post by sorin_ristache »
If different caching strategies are needed for different directories on the web server then it surely sounds like a good idea.
The only disadvantage that I can see is a little slower access to the WebHelp pages due to the requirement to check all ancestor directories on the web server for .htaccess files.
The only disadvantage that I can see is a little slower access to the WebHelp pages due to the requirement to check all ancestor directories on the web server for .htaccess files.
Regards,
Sorin
<oXygen/> XML Editor Support
Sorin
<oXygen/> XML Editor Support
-
- Posts: 9
- Joined: Wed May 08, 2013 11:20 pm
Re: Prevent WebHelp Caching in Browser.
Post by runleonarun »
Do I need to run the ant -f integrator.xml in the DITA-OT after adding this info to the files?
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Prevent WebHelp Caching in Browser.
Post by bogdan_cercelaru »
Hello,
No, you don't need to run "ant -f integrator.xml" after adding this.
Regards,
Bogdan
No, you don't need to run "ant -f integrator.xml" after adding this.
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Prevent WebHelp Caching in Browser.
Post by bogdan_cercelaru »
Hello,
Unfortunately we don't have a mechanism to invalidate the entire HTML files. This is controlled by the web server or the client browser.
More information about how browser caching works can be found here: https://developer.mozilla.org/en-US/doc ... TP/Caching
You can add the following header field in each HTML files
<meta http-equiv="Cache-control" content="no-cache" />
using the "webhelp.fragment.head" parameter. More information can be found here: https://www.oxygenxml.com/doc/versions/ ... gment_head
Regards,
Bogdan
Unfortunately we don't have a mechanism to invalidate the entire HTML files. This is controlled by the web server or the client browser.
More information about how browser caching works can be found here: https://developer.mozilla.org/en-US/doc ... TP/Caching
You can add the following header field in each HTML files
<meta http-equiv="Cache-control" content="no-cache" />
using the "webhelp.fragment.head" parameter. More information can be found here: https://www.oxygenxml.com/doc/versions/ ... gment_head
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service