Solved

Coldfusion ColdBox How to disable cache in Development Environment

Posted on 2014-03-12
12
538 Views
Last Modified: 2014-03-17
i just started learning COLDBOX. i build development environment. but coldbox giving me very hard-time. when ever i change some thing in code. it doesn't reflect in view.
it is caching and im not able to disable.

coldbox website there all are experts answering but problem is they  treat everyone like a expert. so some time really hard to understand.
0
Comment
Question by:xeondxb
  • 6
  • 5
12 Comments
 
LVL 19

Assisted Solution

by:erikTsomik
erikTsomik earned 334 total points
ID: 39925010
Are you talking about query caching or template caching. What version of the coldbox you are on
0
 
LVL 25

Assisted Solution

by:dgrafx
dgrafx earned 166 total points
ID: 39925341
i can't just post it all here as there are many things to consider but here is an article that describes how to setup to auto clear your cache

http://java.dzone.com/news/clearing-coldbox-cached-views


also have a look here at the cachemanager config
https://www.assembla.com/code/coldbox-template/subversion/nodes/coldbox/system/cache/CacheManager.cfc?rev=5

and also at this conversation
https://groups.google.com/forum/#!topic/coldbox/_04_3ENE0gQ

sorry but there is too much to paste here and you should brush up reading some of this stuff as well

good luck ...
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 39925487
Are you sure it is view that being cached. Check config.cfc and make sure if you  are in dev environment set handlerCaching to false and eventCaching set to false
0
 

Author Comment

by:xeondxb
ID: 39925536
Config.cfc
<cfcomponent output="false" hint="My App Configuration">
<cfscript>
// Configure ColdBox Application
function configure(){

	// coldbox directives
	coldbox = {
		//Application Setup
		appName 				= "Simple Crud With REST",

		//Development Settings
		debugMode				= true,
		debugPassword			= "",
		reinitPassword			= "",
		handlersIndexAutoReload = true,

		//Implicit Events
		defaultEvent			= "contacts.index",
		requestStartHandler		= "",
		requestEndHandler		= "",
		applicationStartHandler = "",
		applicationEndHandler	= "",
		sessionStartHandler 	= "",
		sessionEndHandler		= "",
		missingTemplateHandler	= "",

		//Error/Exception Handling
		exceptionHandler		= "",
		onInvalidEvent			= "",
		customErrorTemplate		= "",

		//Application Aspects
		handlerCaching 			= false,
		eventCaching			= false
	};

	// Custom Settings
	settings = {
	};

	// environment settings, create a detectEnvironment() method to detect it yourself.
	// create a function with the name of the environment so it can be executed if that environment is detected
	// the value of the environment is a list of regex patterns to match the cgi.http_host.
	environments = {
		development = "^localhost,^cf,^railo"
	};

	//Layout Settings
	layoutSettings = {
		defaultLayout = "Layout.Main.cfm"
	};

	//Register interceptors as an array, we need order
	interceptors = [
		 //SES
		 {class="coldbox.system.interceptors.SES"}
	];

	datasources = {
		myDSN = {name="contacts",dbtype="mssql"}
	};

}

function development(){
	coldbox.debugPassword = "";
	coldbox.debugMode = true;
	coldbox.reinitPassword = "";
	coldbox.handlerCaching = false;
	coldbox.handlersIndexAutoReload = true;
	coldbox.eventCaching = false;
}

</cfscript>
</cfcomponent>

Open in new window

CFADMIN.jpg
0
 

Author Comment

by:xeondxb
ID: 39925546
Coldbox.cfc
 
function development(){
       coldbox.debugPassword = "";
       coldbox.debugMode = true;
       coldbox.reinitPassword = "";
       coldbox.handlerCaching = false;
       coldbox.handlersIndexAutoReload = true;
       coldbox.eventCaching = false;
}
 
Cachbox.cfc
 
defaultCache = {
                           objectDefaultTimeout = 0.1, // 120, <-- Default two hours default
                           objectDefaultLastAccessTimeout = 30, //30 minutes idle time
                           useLastAccessTimeouts = true,
                           reapFrequency = 2,
                           freeMemoryPercentageThreshold = 0,
                           evictionPolicy = "LRU",
                           evictCount = 1,
                           maxObjects = 300,
                           objectStore = "ConcurrentStore", //guaranteed objects
                           coldboxEnabled = true
                     },
                     
                     // Register all the custom named caches you like here
                     caches = {
                           // Named cache for all coldbox event and view template caching
                           template = {
                                  provider = "coldbox.system.cache.providers.CacheBoxColdBoxProvider",
                                  properties = {
                                         objectDefaultTimeout = 0.1, // 120, <-- Default
                                         objectDefaultLastAccessTimeout = 30,
                                         useLastAccessTimeouts = true,
                                         reapFrequency = 2,
                                         freeMemoryPercentageThreshold = 0,
                                         evictionPolicy = "LRU",
                                         evictCount = 2,
                                         maxObjects = 300,
                                         objectStore = "ConcurrentSoftReferenceStore" //memory sensitive
 

Open in new window

0
 

Author Comment

by:xeondxb
ID: 39925552
problem is!

Im fresh in coldbox. when I change anything in my code I should see the changes Right?
but in my case,  when I restart CFServer then start getting errors even, I fix those errors still I have to restart the cfserver to get right message.it is really annoying.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 19

Expert Comment

by:erikTsomik
ID: 39925580
well try reinitializing the framework. just add &fwreinit to the url . You do not have restart CF server all the time. You can also hide debugger by adding debugmode=false to the url
0
 

Author Comment

by:xeondxb
ID: 39925720
Great it is working!!!!!!!!!!!!!!!!!!!!!!!!!!!

this fwreinit working so, do I have to use this switch every time whenever i'll refresh my development page?
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 39926146
While you are developing I would do this when You are making a change to the handlers and make sure clearing the browsers cache when you work on the styles CSS
0
 
LVL 19

Accepted Solution

by:
erikTsomik earned 334 total points
ID: 39926154
Debugmode=true will help you see the rc collections (but it will be a little slow). Also once you are done with the development I would make handlerCaching is set to true in production it will make the app runs faster
0
 

Author Comment

by:xeondxb
ID: 39936080
Coldbox team member helped me to solve the issue. It was in my programming technique i was writing my query in method. Coldbox was working fine it was caching method i shouldn't be writing full query with condition also, when i was changing condition in query  results was not changing i should  be pass values to a method and  based on those values query should react.

anyway problem has been solved thanks for every way....
0
 

Author Closing Comment

by:xeondxb
ID: 39936081
Thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now