Nginx Pagespeed模块无法正常工作

时间:2018-09-27 08:51:22

标签: django nginx pagespeed

我将Nginx上的Pagespeed模块与Google页面的配置结合使用:

pagespeed on;

# Needs to exist and be writable by nginx.  Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;

# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
  add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

我正在使用uwsgi作为Django应用程序的服务器。

Pagespeed不能很好地书写某些图像的网址,例如传单地图库的网址: https://example.com/static/css/images/xmarker-icon.png.pagespeed.ic.is6gszlWFp.webp%22)marker-icon.png应该是https://example.com/static/css/images/xmarker-icon.png.pagespeed.ic.is6gszlWFp.webp

另一个大问题是,我有一个带有已声明常量的JS脚本,它们可以很好地自我导入,但是当它们被调用时,它表明常量不存在...

0 个答案:

没有答案
相关问题