所以我的应用程序使用了大量的js文件。那很多的http请求。我决定将它们动态地在服务器上以功能组合的3-4个文件组合起来。会动态创建JavaScript文件吗?
我的客户端的请求是: ...脚本类型= “文/ JavaScript的” SRC = “http://mydomain.com/core-js.php” ......
我服务器端: --core-js.php-- header(“Content-type:application/x-javascript”);
include_once( 'file1.js'); include_once('file2.js'); include_once('file2.js'); include_once('file3.js'); include_once('file3.js'); include_once('file4.js'); include_once('file4.js');
我在core-js.php上设置了一个很远的未来过期头文件。我的问题是,是否将core-js.php缓存在客户端?如果是的话,有人可以解释一下吗?
谢谢!
你想让它们缓存吗?请问core.js.php总是返回相同的javascript,还是根据页面的需要动态组装? – Rob 2010-03-31 15:24:21
我想让他们缓存。它每次都是相同的文件集合。 – venksster 2010-04-05 15:30:33