Forum

HTTP Header

Marc
21 August 2018, 20:15
Hello,

I can not figure out how to use the HTTP Header to perform basic Cache-Control . :/
Directory {
DirectoryID = static
Path = /
ExpirePeriod = 2 months
Extensions = css, js, jpeg, jpg, png, gif, ico
}

In my vHost:
VirtualHost {
Hostname = site.pem
WebsiteRoot = /var/www/hiawatha/site/public/web
StartFile = index.php
AccessLogfile = /var/www/hiawatha/site/access.log
ErrorLogfile = /var/www/hiawatha/site/error.log
TimeForCGI = 25
UseFastCGI = PHP7.0
RequireTLS = yes
UseToolkit = site
UseDirectory = static
TLScertFile = tls/site.pem
}

UrlToolKit
UrlToolkit {
ToolkitID = site
RequestURI exists Return
Match ^/(.*)\?(.*) Rewrite /index.php?p=$1&$2
Match ^/(.*) Rewrite /index.php?p=$1
}

Hiawatha -m
Enabled modules: Cache, ChallengeClient, FileHashes, IPv6, Monitor, ReverseProxy, TLS v2.8.0, ThreadPool, UrlToolkit, XSLT
Hiawatha -v
Hiawatha v10.8.1

I also do not get to work: CustomHeaderClient or CustomHeader.

I also have set: CacheRProxyExtensions = css, gif, html, jpg, js, png, txt

Could somebody tell me what I do wrong? I do not get any Hiawatha error and this is bugging me for days now :/
Thanks
Hugo Leisink
21 August 2018, 22:43
Can you provide me with a bit more information than 'do not get to work'?
Marc
22 August 2018, 18:10
Yes! I am sorry - Thanks for your fast reply.

Google Pagespeed Insights tells me to use Browser Caching with the HTTP Header.

If I look into my console (firefox), I see that Hiawatha Responses on Images without any Cache-Control,
My Browser Request ist: Cache-Control: max-age=0 but Hiawatha simply ignores that.

What I mean with "do not get to work" -> Hiawatha does not use the function it seems to me. It won't send any HTTP Header that I want it to send. (Even after I restarted Hiawatha, the correct Hiawatha.conf is used.)

I hope this is enough information for you.
Marc
22 August 2018, 18:14
Addition:
If I check the GET on / of my website, I get:
Cache-Control:no-store,no-cache,must-revalidate
Pragma:no-cache
Transfer-Encoding: chunked (I tried to edit it to gzip or * but I do not get this to work as well. Tried with CustomHeader)
I read that Hiawatha uses gzip on its own and I think that is great but it won't be shown to the browser or Google Pagespeed. :/
I saw the gzipped file on my server though, I searched the forum for this information.
Marc
22 August 2018, 18:16
I could change the ServerString successfully btw. I tried that out and I can change Hiawatha v. to whatever and that works and is shown but everything else stays the same.
Hugo Leisink
24 August 2018, 00:44
Can you tell me the URL of your website?
Marc
24 August 2018, 18:42
Sure thing, I really appreciate your help. It is https://a.viqu.de but I guess viqu.de would work as well.
Hugo Leisink
28 August 2018, 10:02
In your virtual host configuration, I see "Hostname = site.pem". That doesn't seem to be correct...
Marc
29 August 2018, 19:54
I just wrote that up there to "censor" the URL, don't know why I censored with site.pem though, my bad for that. - The real config is: Hostname = a.viqu.de
Marc
29 August 2018, 19:55
Right now the server is down - My hoster fixes something on their system, maybe the recent intel bug.
Marc
30 August 2018, 22:26
Server is back up again. If you have any idea left, feel free to reach out to me, I have a catch all mail for my domain and I also will check this forum.

I compiled the source by myself with your guide - I will setup Hiawatha on another server Debian Stretch instead Jessie and maybe it will work. I will report back in if you are interested. I hope I can find the solution.

Btw: I like to support You / Hiawatha - How can I help / donate ? I also offer to translate part for part to German.
Hugo Leisink
6 September 2018, 15:32
Sorry for late response. Been very busy.

I have no idea what goes wrong. I've double checked. Hiawatha works as intended. Or you made some sort of mistake in the config (which makes Hiawatha end up in another virtual host config section?) or a reverse proxy in front of your webserver is filtering headers. I don't know...
Marc
9 September 2018, 22:55
Hey, no Problem
I will recheck everything as well
This topic has been closed.