php - What does setting Content-Encoding to true do? -
i've come across line in php code i've inherited:
header('content-encoding: ', true);
looking @ mdn docs content-encoding 'true' not valid value. expecting gzip or deflate, not true.
i looked , can't see special behaviour in php if set true.
however in code looking @ line has following effect: makes file being output zipped. adds empty content-encoding header http response headers. latter understand - former not.
there interaction here use of php's ob_gzhandler() has been called , have have correctly set content-encoding header correctly gzip.
if comment out line file not zipped.
what appears happening this:
ob_gzhandler()
sets content-encoding header gzip. subsequent line: header('content-encoding: ', true)
- called after ob_end_clean()
somehow enables prior setting - without prior setting ob_gzhandler not 'activated'. make sense?
basically - why want do:
header('content-encoding: ', true);?
Comments
Post a Comment