Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
cache system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
13 Apr 2014 at 15:03 UTC
Updated:
11 Mar 2016 at 15:03 UTC
Jump to comment: Most recent
While debugging drupal 8 it would be very nice to disable render cache system to help narrow down issues in the render api pipeline.
Provide a setting in settings.php to allow the render caching to be completely disabled.
@todo
n/a
n/a
Comments
Comment #1
wim leersThanks for opening this :) That's how I remembered to do this in #2226761-23: Change all default settings and config to fast/safe production values — please try and give feedback on that patch :)
Comment #2
roderikSince this is issue seems to be much more google-able for novices than a documentation page on disabling caching in your setup (if that exists):
This is how to do it now in your settings.php:
Comment #3
cfreed commentedUsing the settings proposed in #2 I get the following error:
Corollary, using
\Drupal::getContainer()->getServiceIds()I see thatcache.backend.nullis not on the resulting list.With "cache.backend" prefix I only find:
So what is the good way now?
Thanks in advance
Fred
Comment #4
tobiberlinWhen changing these settings in a settings.php of an already installed project make sure to call PROJECT_ROOT/core/rebuild.php - this avoids the mentioned exception in #3
Comment #5
cfreed commentedHi tobiberlin,
Thanks for this advice, but calling PROJECT_ROOT/core/rebuild.php also fires the same error!
Did I missed semothing?
Comment #6
fatiharchitecture commentedrebuild.php removes error messages but can't change the cache situation it seems it is a bug in D8 core
Comment #7
fatiharchitecture commentedat the end I disable cache with this answer I configure files and call core/rebuild.php
http://stackoverflow.com/questions/26676655/disable-entire-cache-for-development
Comment #8
imanoop commentedHi
First you need to copy the development.services.yml from sites folder to sites/default to services.yml and changes the
twig.config:
debug: true
auto_reload: true
cache: false
It will work for disable cache at the development time.
Comment #9
jpkrc commentedI have a D8 site with a page which allows all users - including anonymous - to see a list of results files held in a directory. The list changes all the time. However, an anonymous user sees only the last cached list - which is out-of-date. I have been trying to disable page caching using various methods.
This is the only method which I have found to work:
- copy /sites/example.settings.local.php to /sites/default/settings.local.php
- edit it to uncomment the two lines which disable the caches
- edit /sites/default/settings.php at the bottom to uncomment the lines which include settings.local.php
- do a rebuild: localhost/sitename/core/rebuild.php (don't forget the .php or you get lots of error messages)
This works and the page always gives an up-to-date list of files. However, I have now lost caching for all other pages.
It would be very helpful if someone more expert than me could provide working examples of turning off the internal page cache using the render array when, say, creating a form which must never be cached (as I could not get that to work). Thanks.