Non-dynamic custom HTTP headers

后端 未结 3 633
南方客
南方客 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:15

    This is the kind of thing you do with a mod_perl extension, to intercept these requests and add additional headers before allowing Apache to continue handling it.

    One purely PHP approach which might work is to have the requests route through PHP using mod_rewrite, add the additional header, but then let Apache handle the rest by using the virtual function.

    Alternatively, you could use your database of durations to contruct a static .htaccess file which uses mod_header to insert the correct duration header for each requested file.

提交回复
热议问题