Non-dynamic custom HTTP headers

后端 未结 3 611
南方客
南方客 2021-01-07 12:06

According to this Mozilla article on Ogg media, media works more seamlessly in the browser with an X-Content-Duration header, giving the length in seconds of th

3条回答
  •  再見小時候
    2021-01-07 12:26

    I don't have examples, but you should be able to use mod_header to specify HTTP Response headers at the .htaccess level.

    Of course, the question of where should I add the header really depends on how you are accessing it. If you are just hitting a static resource for download, adding it via Apache makes sense. However, you mention a DB. If you decide to store those files in a database, then you have some API providing the file, in which case that API implementation should append the header and not offload to apache.

    Also, if the dynamic data you are wanting ever requires processing to determine (its not in the filename or etc) then you're already using some code engine to achieve it, just let that add the header.

提交回复
热议问题