How to disable cache during development?

tebe
Member | 3
+
0
-

I wanted Nette to give a try, but after searching and googling more than an hour for a really simple question I'm quite disappointed.

How can I disable cache during development?

Tips here are outdated or didn't work:
https://forum.nette.org/…older-at-all

Any idea?

Best regards,
Tebe

Felix
Nette Core | 1245
+
0
-

I would set it like this.

services:
	cache.storage: Nette\Caching\Storages\DevNullStorage

It's in the doc (https://doc.nette.org/en/caching#…).

You can reach me on Gitter, if you gonna need more help (https://gitter.im/f3l1x).

tebe
Member | 3
+
0
-

Thanks, but exactly this didn't work for me.

Are we talking about this config file where the cache.storage should be set?

https://github.com/…/common.neon

Like this?


parameters:


application:
	errorPresenter: Error
	mapping:
		*: App\*Module\Presenters\*Presenter


session:
	expiration: 14 days


di:
	export:
		parameters: no
		tags: no


services:
	cache.storage: Nette\Caching\Storages\DevNullStorage
	- App\Router\RouterFactory::createRouter

Doesn't work, cache files are still generated. Edits in latte files aren't visible until I clear the temp/cache folder.

Last edited by tebe (2021-06-26 14:34)

Marek Bartoš
Nette Blogger | 1275
+
+2
-

Latte and DI have separate caches, unrelated to nette/caching. While latte cache can be disabled, I wouldn't recommend it because it's quite slow. You can instead enable debug mode with which cache is reloaded when latte file changes.

Here is how you can enable debug mode:
https://doc.nette.org/…on/bootstrap#…

Last edited by Marek Bartoš (2021-06-26 14:45)

tebe
Member | 3
+
0
-

I've been looking at the wrong end. Enabling debug mode works seamlessly and configuring is in fact quite easy.

Thank you.

Last edited by tebe (2021-06-27 14:58)

estgee
Member | 4
+
0
-

Thanks for your tips guys! You really helped me out.