Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
编译所有资产后,Jammit 不会将查询字符串附加到生产环境中的文件。
这给我带来了缓存问题,因为我的 Web 服务器使用查询字符串来破坏缓存。
如何使用 jammit(或其他工具)正确地丑化、连接和附加查询字符串?
添加响应以防其他人遇到此问题。
Jammit 在连接 css 文件时会重写相对 url。这是必要的,因为 css 中的相对路径是相对于包含该路径的文件而言的,所以当 css 文件串联时,需要重写这些路径。在这个重写过程中,Jammit 似乎删除了查询参数。据我了解,要解决此问题,您需要 1)在您的 css 文件中使用绝对 url 2)修补 Jammit。