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?
相关问题
- Drupal 8: How do I customize a form widget to show
- drupal :: order complete hook and upgrade user per
- Change redirect in Drupal 7 for Password Recovery
- Adding attachment to Jira's api
- Understanding htaccess Filesmatch code
相关文章
- Render a Drupal node
- How to allow multiple blocks in a module of Drupal
- How can I redirect a Drupal user after they create
- Drupal 6: Getting custom fields into the database
- Drupal 7 retain file upload
- Drupal - Set 'user/%/edit/uprofile' to def
- Drupal Session User id for independent script
- Drupal - Replace the home page
It’s advisable to use CSS cache for Drupal optimization. To check your changes in CSS simply go to “admin/settings/performance” in Drupal 6 and "admin/config/development/performance" in Drupal 7 and disable “Optimize CSS files" in Drupal 6 and “Aggregate and compress CSS files" in Drupal 7 instead of turning off caching completely.
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.
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:
Go to /admin/settings/performance where there is a field labeled "Optimize CSS files":
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...
Have a look at Disabling the Drupal cache. That should get you going in the right direction.
This approach is version agnostic. The code in this example is for Drupal 7.
Step 1: @include a template preprocess file at the beginning of your template file. (if present). This file is not added to the repository (ignored for version control (Git)), so it is not distributed across environments and each dev can have its own actions and settings in this file.
Step 2: In this file, do your local template preprocess stuff like:
Additionally, you can flush all your caches for DEV only.
Also, for the purpose of development you could place the following in your template.php (assuming you're working on a theme).
See http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_flush_all_caches/6
For Drupal 7 just add this to settings.php:
It will override the current settings on "Performance" (admin/config/development/performance), and if you delete the above lines you will see the original configuration after clean cache.