Ipstenu / varnish-http-purge

Proxy Cache Purge
Apache License 2.0
46 stars 47 forks source link

"The "Age" header is set to an invalid time, which will result in incorrect caching." #73

Closed ivanovalex02 closed 6 years ago

ivanovalex02 commented 6 years ago

https://github.com/Ipstenu/varnish-http-purge/blob/3b00c5aadb6f4a20877311a7f3c256b2cfbebcfd/debug.php#L594

Any ideas why do we need strtotime here?

Ipstenu commented 6 years ago

Because strtotime can be used to determine if the time is a valid time (and not say February 30, 2018).

What's the actual problem you're having?

Ipstenu commented 6 years ago

Assuming this issue is due to incorrect server configurations. Please feel free to leave more information, but without knowing what the problem is (beyond the debugger telling you that your age headers are broken) there's nothing to fix here.

ivanovalex02 commented 6 years ago

Age is delta-seconds https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age

strtotime converts wide variety of trash to a "time":

<?php var_dump(strtotime("1020"));
 >>int(1538673600)

Maybe you do not want to compare this against time()