【发布时间】:2015-06-06 19:18:00
【问题描述】:
我想像 Rails 一样在 Yii 中设置资产编译和压缩。 http://www.yiiframework.com/doc-2.0/guide-structure-assets.html
我正在考虑使用 PHP 缩小器。我宁愿不必手动编译资产并将其签入 Git。然而,即使它有效,Heroku 似乎也不会为不在 Git 中的新文件提供服务器。为什么?
>heroku run bash
Running `bash` attached to terminal... up, run.6857
~ $ cd web
cd web
~/web $ ls
ls
MySample.php css images index.php robots.txt
assets favicon.ico index-test.php js
~/web $ echo hello > hello.txt
echo hello > hello.txt
~/web $ cat hello.txt
cat hello.txt
hello
~/web $ exit
exit
exit
$ curl -I http://xxxxxx.herokuapp.com/hello.txt
HTTP/1.1 404 Not Found
【问题讨论】:
-
我已经知道 Heroku 使用临时文件系统。我不需要保存已编译的资产,因为它们可以在第一次请求时生成。