Adding MetaTags
Moderators: Alexander Halser, Tim Green
-
- Posts: 10
- Joined: Thu Aug 07, 2014 9:54 pm
Adding MetaTags
Hello,
Has anyone ever tried to add metatags for cache control, either in the Help & Manual project file or in the skin? I am totally new to using metatags, but I trying to find a way to deal with Chrome's sticky cache. Our web developer pointed me in the direction of metatags.
Thanks,
Lindsay
Has anyone ever tried to add metatags for cache control, either in the Help & Manual project file or in the skin? I am totally new to using metatags, but I trying to find a way to deal with Chrome's sticky cache. Our web developer pointed me in the direction of metatags.
Thanks,
Lindsay
- Martin Wynne
- Posts: 2656
- Joined: Mon May 12, 2003 3:21 pm
- Location: West of the Severn, UK
Re: Adding MetaTags
Hi Lindsay,
The H&M skins already include cache control meta tags, but it's a constant battle of wits with some browsers. For example Firefox ignores them if the page is loaded in an iframe.
I have found the best solution is to use the php file extension option instead of html. PHP files are expected to contain dynamic content (they don't have to), so the browser doesn't cache them. I can now update my Webhelp and have it instantly visible in every browser every time. There is a slight delay as the page runs through the PHP parser on the server, but it's barely noticeable.
And you can insert dynamic PHP content in your topic pages if you wish, such as the current date and time. Put it in the page template, or an HTML Code Block.
regards,
Martin.
The H&M skins already include cache control meta tags, but it's a constant battle of wits with some browsers. For example Firefox ignores them if the page is loaded in an iframe.
I have found the best solution is to use the php file extension option instead of html. PHP files are expected to contain dynamic content (they don't have to), so the browser doesn't cache them. I can now update my Webhelp and have it instantly visible in every browser every time. There is a slight delay as the page runs through the PHP parser on the server, but it's barely noticeable.
And you can insert dynamic PHP content in your topic pages if you wish, such as the current date and time. Put it in the page template, or an HTML Code Block.
regards,
Martin.
-
- Posts: 10
- Joined: Thu Aug 07, 2014 9:54 pm
Re: Adding MetaTags
How do you publish the pages as PHP? I didn't even know that was an option.
-
- Posts: 10
- Joined: Thu Aug 07, 2014 9:54 pm
Re: Adding MetaTags
Or are you using a separate parser?
- Tim Green
- Site Admin
- Posts: 23186
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Adding MetaTags
Hi Lindsay,
You can change the topic file extension to .php or .asp or anything else in Configuration > Publishing Options > WebHelp > HTML Export Options. Then it is up to you to add the appropriate PHP scripts to your templates, of course...Lindsay Colahan wrote:How do you publish the pages as PHP? I didn't even know that was an option.
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
- Martin Wynne
- Posts: 2656
- Joined: Mon May 12, 2003 3:21 pm
- Location: West of the Severn, UK
Re: Adding MetaTags
Hi Lindsay,Tim Green wrote:Then it is up to you to add the appropriate PHP scripts to your templates, of course...
But that is optional. A standard HTML web page works fine with a .php extension. Sorry, I don't know anything about .asp files on Windows servers.
One point to bear in mind is that most browsers won't render local .php files -- you just see the page source. But Microsoft Edge does, so in order to see your project locally after publishing, use Microsoft Edge.
regards,
Martin.
Re: Adding MetaTags
Sometimes it just needs a little bit of sideways thinking. Browser and proxy server caching has been the bane of my life for years, not just in regard to H&M HTML outputs. So you can rest assured a little .php even though it contains not PHP experiment will begin tomorrow.
If this forum supported awarding stars you'd have one for the suggestion Martin. Bravo.
If this forum supported awarding stars you'd have one for the suggestion Martin. Bravo.
Re: Adding MetaTags
I have a website which hosts over 70 documents output as sets of H&M HTML. To let users navigate between docs, its all accessed via an HTML page that defines a set of frames.
That's all password restricted by a corporate security server that provides the login page and is very slow to respond at time. Combine that with the caching even when told not to tendency of some browsers and we were forever seeing the login page getting loading into a sub-frame that wasn't suitable for it (slow security page serving and unresponsive login page design).
Having now changed the name of the framing page to .php, after a month of usage no-one has reported that error again.
That's all password restricted by a corporate security server that provides the login page and is very slow to respond at time. Combine that with the caching even when told not to tendency of some browsers and we were forever seeing the login page getting loading into a sub-frame that wasn't suitable for it (slow security page serving and unresponsive login page design).
Having now changed the name of the framing page to .php, after a month of usage no-one has reported that error again.