为网站编译静态内容
我一直在寻找有关如何管理 Web 应用程序静态内容的技术。据我所知,有一种纯粹的面向对象方法,将所有特定需求打包在对象元数据中,并为每个请求路径实时或编译时生成单个 CSS 和 JS 文件。还有在每个版本上手动合并的技术。
我的问题是,在管理动态 Web 应用程序的静态数据时,您认为哪些通用技术有用,并且您是否发现任何特定的软件有用(除了 SVN/Git/等)?
I've been looking for techniques on how to manage static content for a web application. From what I've found, there is the pure OO approach, packaging all specific requirements in object metadata and generating a single CSS and JS file for each request path either in real time or compile time. There is also the technique of manually merging on each release.
My question is, what general techniques do you find useful when managing static data for a dynamic web application and have you found any particular software helpful (besides SVN/Git/etc.)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 Phing(Ant for PHP)通过压缩器运行 CSS/JS。从用户的浏览器中,这些压缩文件可以通过资源检索器访问,就像 Facebook 的 rsrc.php 一样。该脚本将生成的名称映射到物理名称,以进行浏览器缓存控制,因为缓存周期相当长。当 CSS/JS 被压缩以强制用户的浏览器获取新副本时,这些名称也会发生变化。
I use Phing (Ant for PHP) to run the CSS/JS through a compressor. From a user's browser, these compressed files are accessed via a resource retriever much like Facebook's rsrc.php. This script maps generated names to the physical names for browser cache control because the cache periods are rather long. These names are also changed when the CSS/JS is compressed to force users' browsers to grab fresh copies.