Software > HFS ~ HTTP File Server

Controlling the Cache-Control header

(1/3) > >>

Smile4ever:
Hi. I would like to set Cache-Control to "Public" instead of the default "no-cache, no-store, must-revalidate, max-age=-1".

I tried Other options -> Edit event scripts with this:
[request]
{.add header|Cache-Control: Public.}

But it doesn't work. What did I do wrong?

Mars:
Unfortunately since several versions, Rejetto has deleted an extension of the ADD HEADER macro to add an option to an existing header. The addition of this macro in the [request] section has no direct effect on the MAIN section of template. To do this, you must take the default values and add it directly to the template


--- Quote ---<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
{.add header|Cache-Control: no-cache, no-store, must-revalidate, max-age=-1, public.}

.... the rest of template
--- End quote ---

In the model there are four sections containing DOCTYPE html, it will then be necessary to add the macro to each

Smile4ever:
Thanks for your reply. I tried adding {.add header|Cache-Control: no-cache, no-store, must-revalidate, max-age=-1, public.} after each </head> but it didn't work, the default Cache-Control value is still used. I also tried {.add header|Cache-Control: Public.} but that didn't work either. I even closed and restarted HFS to no avail.

A workaround (using the older version of HFS) is welcome too, if you know enough details.

Mars:
I checked that 'public' was present in the answer using HTTPFOX plugin in Firefox, so if your browser does not respond correctly, either it does not fit or it conflicts with another value By default. Reduce the number of values to detect a possible conflict in Cache-Control

The macro in its form is sufficient, a later version will not bring a better result

What's different with the old version was the use of the macro in the form to add a header element without deleting its contents

{.add header|Cache-Control: Public|overwrite=0.}
 overwrite not working since several build and is true (1) by defaut and is ignored in the macro

Mars:
Si je me fie à  google, j'ai bien à faire à une personne en belgique ou utilisant un proxi de ce pays?

Navigation

[0] Message Index

[#] Next page

Go to full version