Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3 validator Baidu errors. #1646

Closed
ivan-nginx opened this issue May 3, 2017 · 5 comments
Closed

W3 validator Baidu errors. #1646

ivan-nginx opened this issue May 3, 2017 · 5 comments

Comments

@ivan-nginx
Copy link
Collaborator

In file layout/_partials/head.swig there are strings:

{# #238, Disable Baidu tranformation #}
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

And W3 validator give 2 errors on this:
image

My questions is:

  1. For what this was doing?
  2. Why this give errors?
  3. If it only for Baidu and if it really need, may be we can add switch option to disable it errors when Baidu not used?
{% if theme.baidu_push or theme.baidu_analytics %}
  {# #238, Disable Baidu tranformation #}
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
{% endif %}

What u think about it?

@iissnan
Copy link
Owner

iissnan commented May 3, 2017

Baidu is a search engine that likes Google, it is widely used in China. Baidu transforms sites using their own presentation fot mobile devices, those two meta are used to tell Baidu not to do the transformation.

I think we should add an option such as baidub_transformation_disabled so that users can enable it by themselves.

@ivan-nginx
Copy link
Collaborator Author

ivan-nginx commented May 3, 2017

@iissnan ok, but why errors in W3 validator?

And actially, validator say about "Cache-Control" value in http-equiv option on element meta. May be just try to replace it by another option/element?

@iissnan
Copy link
Owner

iissnan commented May 3, 2017

According to the W3C specification, the value for http-eqiuv is not valid. Please see https://www.w3.org/TR/2016/REC-html51-20161101/document-metadata.html#pragma-directives

@ivan-nginx
Copy link
Collaborator Author

ivan-nginx commented May 3, 2017

Yeah, i just see it. And talking about it. I think may try to resolve it.

  1. https://stackoverflow.com/questions/12693630/bad-values-in-meta-tags
  2. https://stackoverflow.com/questions/31290710/bad-value-cache-control-for-attribute-http-equiv-on-element-meta

Only via HTTP-headers will right:

header("Cache-Control: no-cache, must-revalidate"); 
header("Pragma: no-cache");

@ivan-nginx
Copy link
Collaborator Author

@iissnan @Acris @ can we resolve this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants