Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:20:50+00:00 2026-06-07T18:20:50+00:00

I’ve been noticing on my CF server that my apps are starting to get

  • 0

I’ve been noticing on my CF server that my apps are starting to get quite slow. I’m attributing much of this to not caching some things, when indeed they should be cached.

I would like to verify that this object is in the application scope and not create it every time the page loads.

<cfset application.components.blog = createObject('component','sharedcomponents.cfc.blog').init()>

What would be the best way to verify if the object exists within the Application scope and if it is let it go. Also if the files have been updated, how to detect the changes so the entire app refreshes it?

Any suggestions greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:20:53+00:00Added an answer on June 7, 2026 at 6:20 pm

    You don’t say where that code is or how / when it’s executed, so it’s impossible to confidently answer your question.

    If it’s in onApplicationStart() in Application.cfc, then – yeah – it’ll only be executed when the application starts.

    If, however, it’s just in some file, it’ll be re-executed every time that file is called, unless you take measures to ensure it’s not called. EG: put a condition around it:

    <cfif not (structKeyExists(application, "components") and structKeyExists(application.components, "blog"))>
        <cfset application.components.blog = createObject('component','sharedcomponents.cfc.blog').init()>
    </cfif>
    

    You seem to be wondering if some magic takes place in that because your variable assignment sets something in the application scope that CF will automatically know not to rerun it if the file its in is reexecuted. No. CF just does what it’s told: if you tell it to run that code, it will be run. Irrespective of which scope the variable is being assigned in.

    You go on to ask about detecting if files have been updated and accordingly restart the whole application. How are these files being updated? I presume it’s part of an active deployment process (eg: you do something to deploy them). If this is the case, aren’t you in the best position to know when the application needs restarting? For one thing, not every code change is going to warrant an application restart, so you’re not going to want to do it automatically, I should think?

    You should have a script that runs applicationStop() if you need to restart the app. Some people have their onRequestStart() check for a URL param which then calls applicationStop() if it’s passed, but I personally think that’s the wrong place to do it. For almost every request that condition will be irrelevant, so there’s not point checking it every request for the one-in-a-million occasion that it’s actually pertinent. I prefer having a separate script to do it, which is called as needs must.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.