Solved

Coldfusion ColdBox How to disable cache in Development Environment

Posted on 2014-03-12
12
529 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
Comment Utility
Are you talking about query caching or template caching. What version of the coldbox you are on
0
 
LVL 24

Assisted Solution

by:dgrafx
dgrafx earned 166 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 19

Expert Comment

by:erikTsomik
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

12 Experts available now in Live!

Get 1:1 Help Now