Problem with filter convert_meta_tags

瀏覽次數:36 次
跳到第一則未讀訊息

Florian George

未讀,
2015年11月17日 上午11:41:382015/11/17
收件者:mod-pagespeed-discuss
Hi,

i want to convert all "meta http-equiv" from a HTML file to real HTTP headers.

These are the relevant config lines in my apache 2.4:

LoadModule pagespeed_module modules/mod_pagespeed_ap24.so
ModPagespeed On
ModPagespeedFileCachePath "/tmp/mod_pagespeed/"
ModPagespeedRewriteLevel PassThrough
ModPagespeedEnableFilters convert_meta_tags
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

The HTML file i am using for testing is the following:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Test" content="12345">
</head>
<body>
Test
</body>
</html>

I expected to see a response header "Test" with the value "12345", but unfortunately there is no such header set.

Am i doing something wrong?

Otto van der Schaaf

未讀,
2015年11月17日 下午3:31:042015/11/17
收件者:mod-pagesp...@googlegroups.com
Looking at the source code, it looks like only Content-Type and charset declarations are actually moved to the response headers. 
So for example, I would expect "<meta charset=“utf-8”>" and "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' >" to be moved.

The documentation [1] says:

The 'Convert Meta Tags' filter adds a response header that matches each meta tag with an http-equiv attribute. For example, <meta http-eqiv="Content-Language" content="fr"> would be converted to Content-Language: fr in the response headers. The original tag is left unchanged.

This looks wrong to me, I can't see how the filter would convert the example it gives for Content-Language to a header right now.


Otto 


--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/05e7d02f-aa17-4c06-bc54-3f96e52eecb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jan-Willem Maessen

未讀,
2015年11月17日 下午3:45:222015/11/17
收件者:mod-pagesp...@googlegroups.com
I also notice there's no representative page in the mod_pagespeed_examples.

Joshua Marantz

未讀,
2015年11月17日 下午3:51:552015/11/17
收件者:mod-pagespeed-discuss
convert_meta_tags originally had an implementation that matched the doc: converted all meta tags.  However we built the thing originally to help browsers -- IE8 in particular -- discover the correct encoding earlier and avoid reparsing, hence the focus on charset.

We found that other meta-tag conversions caused bugs, e.g.


I think there were others.  In any case we should update the misleading doc.

-Josh



Joshua Marantz

未讀,
2015年11月17日 下午6:13:342015/11/17
收件者:mod-pagespeed-discuss
FWIW I have a doc update pending for convert_meta_tags to bring it up to date.

-Josh

訊息已遭刪除

Karsten Kraus

未讀,
2016年4月12日 上午11:34:282016/4/12
收件者:mod-pagespeed-discuss
Hi there,

i've had the same misconception about the abilities of the convert_meta_tags-filter because the docs at https://developers.google.com/speed/pagespeed/module/filter-convert-meta-tags#configuration are still unclear about the restriction to Content-Type. The restriction is only mentioned in the risks part of the documentations.

Perhaps you should remove/correct the sentence above the examples which reads "The 'Convert Meta Tags' filter adds a response header that matches each meta tag with an http-equiv attribute."

Kind regards

Karsten
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息