Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Coldfusion ColdBox How to disable cache in Development Environment

Posted on 2014-03-12
12
547 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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