【发布时间】:2014-07-01 08:28:51
【问题描述】:
我正在使用 Django Compressor 进行离线压缩并将压缩的静态文件存储在 Amazon S3 上。我的问题是manifest.json 通过将http:// 指定为协议来引用缓存文件:
<link rel=\"stylesheet\"
href=\"http://stage-media.dropspot-app.com.s3.amazonaws.com/static/CACHE/css/abffb776bf3e.css\"
type=\"text/css\" media=\"all\" /><link rel=\"stylesheet\"
href=\"http://stage-media.dropspot-app.com.s3.amazonaws.com/static/CACHE/css/9533603cdbaa.css\"
type=\"text/css\" media=\"screen\"
/>
这会导致通过 HTTPS 访问页面时不会加载缓存文件:
The page at 'https://example.com' was loaded over HTTPS, but ran insecure content from 'http://example.com.s3.amazonaws.com/static/CACHE/css/abffb776bf3e.css': this content should also be loaded over HTTPS.
解决方案是让 manifest.json 引用缓存的文件,但在 url 中没有 http:,但还没有找到以这种方式生成它的方法。
有没有办法使用相对协议的 url 生成 manifest.json?
【问题讨论】:
标签: django amazon-s3 django-staticfiles django-compressor