Post by tomroguk » Fri Aug 04, 2017 3:39 am

Hi all,
Thought I would share a top tip for developers/theme editors if you weren't aware already. You can turn off Opencart cache.

When in the dashboard after logging in, hit the gear icon top right of the page and turn both cache's off.

Took a while for me to find this so hopefully it helps someone.
I found this article helpful: https://webocreation.com/blog/opencart- ... loper-tips

Newbie

Posts

Joined
Sat Jun 08, 2013 4:28 am

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by sputnik-1 » Sat Aug 05, 2017 3:50 am

Thanks tomroguk

That's just what I was looking to do.

User avatar
New member

Posts

Joined
Sun Apr 28, 2013 5:01 am

Post by webbernaut » Fri Feb 22, 2019 10:14 am

Doesn't seem to work for me. Turned them off and template is still caching. Only way I can see new changes is go through their editor. Which as a developer is total waste of time.

Newbie

Posts

Joined
Mon Dec 04, 2017 10:39 am

Post by letxobnav » Wed Feb 27, 2019 4:50 pm

I just call this function in startup.php controller ( only when I am developing).
It clears the caches.

Code: Select all

/* reset_cache() deletes theme cache only */
/* reset_cache('all') deletes theme and file caches */
function reset_cache ($scope = 'theme') {
	// delete theme cache files
	$directories = glob(DIR_CACHE . '*', GLOB_ONLYDIR);
	if ($directories) {
		foreach ($directories as $directory) {
			$files = glob($directory . '/*');
			foreach ($files as $file) {
				if (is_file($file)) unlink($file);
			}
			if (is_dir($directory)) rmdir($directory);
		}
	}
	// delete normal cache files (categories, filters, etc
	if ($scope == 'all') {
		$files = glob(DIR_CACHE . '*.*');
		foreach ($files as $file) {
			if (is_file($file)) unlink($file);
		}		
	}
}

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Wed Feb 27, 2019 8:54 pm

Take note from the above code suggestion that is only clears the theme part but not the sass part of the cache as compared to the admin dashboard.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Wed Feb 27, 2019 10:41 pm

True but I have only seen SASS working to create bootstrap css files in admin, not seen any sass cache files on the catalog side being created.
Then again I am a novice on SASS.

In any event, the dashboard cache control panel does not have a button to clear the filters, catalog, language, currency, etc. cache files.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Wed Feb 27, 2019 11:33 pm

In any event, the dashboard cache control panel does not have a button to clear the filters, catalog, language, currency, etc. cache files.
Hopefully not. Otherwise, it would be unthinkable on the mount of extensions unrelated to those events that would be affected.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Thu Feb 28, 2019 1:20 am

love to read your elaboration on this.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: halfhope and 510 guests