Django 的资产管理器 - 选择哪一个?

发布于 2024-08-10 09:41:13 字数 1539 浏览 3 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

旧伤慢歌 2024-08-17 09:41:13

正如您已经注意到的,它们都做同样的事情(或多或少)。我决定继续使用 django_compressor

另外,我更喜欢在网络服务器级别设置过期标头或应用动态压缩。恕我直言,这些操作不应该由应用程序本身执行,因为有时它可能会导致一些问题,例如在错误页面上设置Cache-Control或过期标头等。mod_expires 模块非常易于根据您的需要进行配置。对于使用 DEFLATE 输出过滤器的即时压缩,我使用了这个 mod_deflate 配置 按原样。

As you have already noticed, they all do the same thing (more or less). I decided to go ahead with django_compressor.

Also, I prefer to set expire headers or apply on-the-fly compression at the web server level. IMHO these operations should not be performed by the application itself, because sometimes it can lead to some issues, for instance setting Cache-Control or expiration headers on error pages etc. The mod_expires module is very easy to configure according to your needs. For on-the-fly compression using the DEFLATE output filter, I have used this mod_deflate configuration as is.

晌融 2024-08-17 09:41:13

自从提出这个问题以来,已经创建了新的项目。

您可能想看看 django-pipeline,它非常漂亮。

New projects have been created since this question was asked.

You might want to take a look at django-pipeline, it's pretty nifty.

谎言 2024-08-17 09:41:13

我一直在使用 django-compress 并且对它很满意,特别是因为我可以指定后端压缩器(例如,YUI 最适合我的 JS)。

我将来可能会考虑切换到 django_compressor,但它的优先级太低了。

我还要指出 django-media-bundler 有一个其他功能没有的功能......自动构建图像精灵。我还没有实际使用过它,所以我不确定它的实现情况如何,但这非常简洁。您可以仅将其用于精灵,并将 css/js 留给其他压缩器之一。

I've been using django-compress and I'm happy with it, especially because I can specify the back-end compressor (YUI works best with my JS for example).

I will probably consider switching to django_compressor in the future, but it's too low priority atm.

I would also point out that django-media-bundler has one feature the others don't... automatic building of image sprites. I haven't used it live, so I'm not sure how well it is implemented but that's pretty neat. You can use it just for the sprites and leave css/js for one of the other compressors.

梦纸 2024-08-17 09:41:13

在众多竞争者中,我选择了django-compressor,因为它使用起来非常简单。只需在模板中放置一两个标签(典型场景:一个用于 css,另一个用于 js),大多数情况下您无需修改​​任何内容即可完成;您甚至不必声明或修改设置,其默认设置就很好。

Among the contenders I have chosen django-compressor because it is incredibly simple to use. Just put one or two tags (typical scenario: one for css and another for js) in the template and for most cases you are done without modifying anything; you don't even have to declare or modify settings, its default settings are good.

自此以后,行同陌路 2024-08-17 09:41:13

FWIW,因为 djangopluggables.com 不再存在,而且没有人在这里提到它:最近的比较位于 djangopackages.com,其中 django_compressor 是最常用的 ATM。还没有在 1.4 上尝试过,正如 Jay Taylor 在他的 评论中警告< /a>.

FWIW since djangopluggables.com doesn't exist anymore and nobody has mentioned it here yet: The most recent comparison is on djangopackages.com, where django_compressor is the most used one ATM. Haven't tried it with 1.4 though as Jay Taylor warned in his comment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文