Drupal — 禁用 CSS 缓存 [英] Drupal — disable CSS cache

查看:15
本文介绍了Drupal — 禁用 CSS 缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的是Drupal 6,每次修改CSS文件都需要清除缓存才能看到更新的结果,很浪费我的时间.有什么办法可以禁用缓存系统吗?

I am using Drupal 6. Every time I modify the CSS files, I need to clear the cache to see the updated result, which is a waste of my time. Is there any way to disable the cache system?

推荐答案

CSS 缓存需要刷新的原因是因为 Drupal 将来自各个模块和主题的所有单独 CSS 文件优化为一个 CSS 文件,然后优化为单个文件.

The reason the CSS cache needs refreshing is because Drupal optimizes all individual CSS files from various modules and themes into one CSS file which is optimized into a single file.

所以这个文件不会在每次页面加载时都重新编译,这会失去优​​化的好处,Drupal 需要知道 CSS 文件何时发生变化才能重新编译它.在哪个缓存刷新似乎是理想的时间.要关闭此功能 - 而不是完全关闭缓存,您可以简单地:

So that this file is not recompiled every page load, which would loose the benefit of optimization, Drupal needs to know when the CSS file has changed in order to recompile this. At which cache refresh seems like the ideal time. To turn this off - rather than turn off caching completely you can simply:

转到/admin/settings/performance,其中有一个标记为优化 CSS 文件"的字段:

Go to /admin/settings/performance where there is a field labeled "Optimize CSS files":

在您进行开发和更改 CSS 文件时禁用此功能.然后在生产中并且设置了大部分 CSS 后,您就可以启用它.我强烈推荐这在加载页面时带来的性能提升.

Disable this whilst you are doing your development and making changes to your CSS file. Then when in production and most of your CSS is set then you can enable it. I highly recommend the performance gains this brings in the loading of your pages.

我已经安装了管理菜单模块,只需单击一下就可以很容易地从这里清空缓存 - 试试看...

I have the administration menu module installed, and it is very easy to empty the cache from here in a single click - have a try...

这篇关于Drupal — 禁用 CSS 缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆