某些字体无法使用Google App Engine(wordpress) [英] Some fonts dont work Google App Engine (wordpress)

查看:42
本文介绍了某些字体无法使用Google App Engine(wordpress)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在GAE中安装了wordpress.我的wordpress安装程序激活了流行的 Woocommerce 插件.此设置的问题是我的某些字体无法正常工作.这是我所看到的:

I have installed wordpress in GAE. My wordpress installation has the popular Woocommerce plugin activated. The problem with this setup is that some of my fonts are not working. This is what I see :

这些盒子实际上应该是星星.我不确定,但是我认为这是因为GAE无法猜测MIME类型.在浏览器控制台中,我收到以下消息

The boxes should actually be stars. I am not sure, but I think this is happening because the mime type cant be guessed by GAE. In my browser console, I get the following messages

资源被解释为图像,但以MIME类型传输应用程序/x-javascript:

Resource interpreted as Image but transferred with MIME type application/x-javascript:

这是我的app.yaml:

this is my app.yaml:

application: XXXXXXX
version: 101
runtime: php
api_version: 1

handlers:
- url: /(.*\.(htm$|html$|css$|js$))
  static_files: wordpress/\1
  upload: wordpress/.*\.(htm$|html$|css$|js$)
  application_readable: true

- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/.*\.(ico$|jpg$|png$|gif$)
  application_readable: true

- url: /(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/\1
  upload: wordpress/.*\.(ico$|jpg$|png$|gif$)

- url: /wp-admin/(.+)
  script: wordpress/wp-admin/\1
  secure: always

- url: /wp-admin/
  script: wordpress/wp-admin/index.php
  secure: always

- url: /wp-login.php
  script: wordpress/wp-login.php
  secure: always

- url: /wp-cron.php
  script: wordpress/wp-cron.php
  login: admin

- url: /xmlrpc.php
  script: wordpress/xmlrpc.php

- url: /wp-(.+).php
  script: wordpress/wp-\1.php

- url: /(.+)?/?
  script: wordpress/index.php

- url: /(.*\.woff)
  static_files: wordpress/\1
  upload: wordpress/(.*\.woff)
  mime_type: application/font-woff

- url: /(.*\.svg)
  static_files: wordpress/\1
  upload: wordpress/(.*\.svg)
  mime_type: image/svg+xml

- url: /(.*\.eot)
  static_files: wordpress/\1
  upload: wordpress/(.*\.eot)
  mime_type: application/vnd.ms-fontobject

- url: /(.*\.ttf)
  static_files: wordpress/\1
  upload: wordpress/(.*\.ttf)
  mime_type: application/x-font-ttf

- url: /(.*\.otf)
  static_files: wordpress/\1
  upload: wordpress/(.*\.otf)
  mime_type: application/x-font-otf

推荐答案

我对pagespeed的有限(可能是过时的)经验表明,您可以考虑禁用它,直到一切正常为止.

My limited (and possibly stale) experience with pagespeed suggests that you might consider disabling it until you have everything else working.

唯一能跳出来的是应该交换您 app.yaml 中的前两个-url:节.这些节按顺序进行咨询./wp-content/foo.js 将与更通用的第一个节匹配,这似乎不是您想要的.我怀疑这是导致mime类型混乱的原因,但是关闭pagespeed应该会为您提供更好的信息,以便进行进一步的调试.

The only thing that jumps out is that the first two - url: stanzas in your app.yaml should be exchanged. These stanzas are consulted in order. /wp-content/foo.js will be matched by the more general first stanza, which looks like it isn't what you want. I doubt that's what's causing the mime type confusion, but turning off pagespeed should give you better info for further debugging.

这篇关于某些字体无法使用Google App Engine(wordpress)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆