0

最近のバージョンの mod-pagespeed を django インスタンスにインストールし、次の pagespeed.conf で CSS/JS を最小化しようとしましたが、remove_comments と collapse_whitespace がうまくいったように見えても無駄でした。

ModPagespeedEnableFilters rewrite_javascript,rewrite_css,flatten_css_imports
ModPagespeedEnableFilters collapse_whitespace,elide_attributes
ModPagespeedEnableFilters combine_javascript,remove_comments

django テンプレートでは、CSS/JS の URL は {{ STATIC_URL }}media/main.js などでポイントされ、一致するフォルダーは apache セットアップでエイリアスとして設定されていましたが、JS/CSS (およびそのリンク) はすべて変更されていません。まったく。

テンプレート エンジンからの介入により、mod-pagespeed が js/css を取得できなかったと思われます..?

4

1 に答える 1

0

私はついに違いを生むオプションを見つけました。

# Explicitly tell mod_pagespeed to load some resources from disk.
# This will speed up load time and update frequency.
#
# This should only be used for static resources which do not need
# specific headers set or other processing by Apache.
#
# Both URL and filesystem path should specify directories and
# filesystem path must be absolute (for now).
#
ModPagespeedLoadFromFile "http://example.com/static/" "/var/www/static/"

ModPagespeedLoadFromFile をコメントアウトし、js/css の静的フォルダーを見つけます

于 2012-07-08T03:15:49.650 に答える