Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Coldfusion ColdBox How to disable cache in Development Environment

Posted on 2014-03-12
12
Medium Priority
?
608 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
[X]
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
  • 6
  • 5
12 Comments
 
LVL 19

Assisted Solution

by:erikTsomik
erikTsomik earned 1336 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 664 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

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.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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