2

I have followed all steps reported on https://www.drupal.org/node/2598914. However, if I create an new template file in my theme folder, it does not get discovered until I flush the cache manually via drush cr.

Is rebuilding the cache a must to discover new templates, or can I optimize the developer settings to auto-discover templates during development?

3
  • If you are editing the files (which also means adding files) of a theme that is used from Drupal, then you need to manually clear the cache, or tell Drupal not to use any cache. I would rather uninstall the theme before any edits, and install it back after the edits.
    – avpaderno
    Commented Apr 16, 2017 at 8:17
  • Which of the disabling methods on drupal.org/node/2598914 did you follow?
    – mona lisa
    Commented Apr 16, 2017 at 17:04
  • I have followed all methods. Uninstalling and installing the theme back is a very slow process, just to see my changes. Than cannot be the workflow. What do I need to do, to be able to work on my templates without having the need to constantly rebuild the cache manually?
    – jepster
    Commented Apr 16, 2017 at 18:18

1 Answer 1

0

try add this in .htaccess (drupal root)

    <IfModule mod_headers.c>
       //ADD THIS 
        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires 0
    </IfModule>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.