Page 1 of 1

Disable template caching for development

Posted: Tue Mar 21, 2017 4:02 am
by RandyRocket
Hi,

I am working on modifications of some templates... Sadly I always have to clear the template cache on the admin page "modifications" for every single template change. Is there a way to temporarily disable the caching completely?

Thanks

Re: Disable template caching for development

Posted: Tue Mar 21, 2017 6:23 am
by IP_CAM
Just disable OcMod, and if installed, VqMod as well. ;)
Ernie
Image

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 1:38 am
by RandyRocket
Hm, but that also disables functionality, no?

Is there another way? Just that caching regenerates on every refresh, for development purposes?

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 2:12 am
by IP_CAM
Well, you either use VqMod/OcMod-Extensions, but then, you'll have to accept cached files, either as
VqMod-generated Content, and/or then as OcMod generated Content. Or then, you'll have to switch those
Routines off, to work with, what the default Code produces. It's as easy as that.
To only mention those two 'Routines', other Cache-Extensions exist as well, like Category/Page
Caching Mod's, doing their own things.And when it comes to Theme Extensions like Journal, or
speed-up Mod's like NITRO, they have/use their own Caching-Techniques. Just to mention this too...
---
One good reason, to create something like shown on the image below, to only require one Admin
Page, to kill everything, without the need, to call multiple Sections, to clear out a system, over&over again. :D
Ernie

Image

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 2:15 am
by RandyRocket
Hm, no, here my problem only is ocmod, not vqmod. vqmod refreshes cache on changes, but not vqmod.

I cannot believe I cannot disable vqmod caching.... Really?

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 2:22 am
by IP_CAM
If an existing Source Code/File is changed/replaced by a VqMod/OcMod Extension Content,
the REPLACEMENT Code/File has to be stored/cached somewhere, to be called, instead
of the DEFAULT Code, in order to function.
is this so hard to understand ? ::)

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 2:52 am
by RandyRocket
Is it so hard to understand there there should be an option "regenerate always" for developers? I think you did not get the point...

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 3:20 am
by artcore
You could generate an ocmodded file and work on that, they are 'live' without a refresh. When done, apply changes to the ocmod.xml
These cache files are in system/storage/modification/
...and you can also add your .ocmod.xml in the system root so it takes without installing it first.
Remember to rename it to install.xml when you wrap it up in an installer

Re: Disable template caching for development

Posted: Thu Mar 23, 2017 11:45 pm
by Johnathan
RandyRocket wrote:
Thu Mar 23, 2017 2:52 am
Is it so hard to understand there there should be an option "regenerate always" for developers? I think you did not get the point...
Yes, this is exactly one reason why many developers (like myself) only use vQmod instead of ocMod. It's too much of a pain to work with and debug. Hopefully Daniel will add an option like this into the core in the future, or if developers are forced to move to ocMod for 3.0 like it seems like they will be, I'll see about creating a mod that does this.

If you want to try creating one yourself, it looks like the refresh() method in /admin/controller/extension/modification.php is the one that triggers this. You could access it by using a URL like this, though it wouldn't work without having an admin token in the URL:

www.yourdomain.com/index.php?route=exte ... on/refresh

If you can't figure out how to get a token in the URL when you access it, you could copy that code somewhere else so it's loaded on every page load.

Re: Disable template caching for development

Posted: Fri Mar 24, 2017 1:35 am
by RandyRocket
Thank you! I will try that. :-\