Solved

Coldfusion ColdBox How to disable cache in Development Environment

Posted on 2014-03-12
12
543 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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