Skip to main content
Known Participant
April 22, 2006
Question

"Save Class Files"

  • April 22, 2006
  • 1 reply
  • 812 views
Hi folks,

I'm running CFMX6.1 with all the current updates loaded (... of that I'm about 99.9% sure...) and I'd like to know:

What exactly is "Save Class Files" for under the CF Administrator mean?

I know what the blurb by the checkbox says, but I don't understand the implications of that statement.
Just as a referesher in case anyone forgot the little blurb says:

quote:

When you select this option, the class files generated by ColdFusion are saved to disk for reuse after the server restarts. Macromedia recommends this for production systems. During development, Macromedia recommends that you do not select this option."


Here's my problem: we have two CF Servers (production/development) both running CFMX6.1, and when accessing a page on the production server, IE is caching it despite our cache-control template being included (standard template that sets the cache control meta tags, etc.). When I tried to reproduce this problem on the development server, I could not. I have IE set to check for new versions of the page on every visit and still I'm getting a cached page when I press the back button.

I checked out the CF Administrator and the only difference in the Caching settings is the lack of a check mark on "Save Class Files" on the development box.

Could enabling this feature cause page caching like I'm seeing?

Thanks.
Chris
    This topic has been closed for replies.

    1 reply

    Participating Frequently
    April 22, 2006
    Hi,
    Save class files will save the compiled byte classes of cfm page to the disk. Lets say you have a test.cfm page, once you request that page, coldfusion will convert that to a byte code and save it to the disk in WEB-INF/cfclasses directory. If you enable save class files, coldfusion will store it to disk and also in memory. If you do not enable it, it will not store it disk but only in memory.

    In production, you generally do not change the cfm's a lot and its better to enable this option. In development, as you keep changing the cfm's, its better to disable it to avoid lot if file operations.

    Hope this helps.

    Swathi.
    Participating Frequently
    April 24, 2006
    I'd just like to add that enabling "Save Class Files" in Production isn't always the best recommendation. (And I personally think Adobe should change this in the CFAdmin).

    The reason being:
    As Swathi says, when you have this option enabled, ColdFusion will load your class files from disk, meaning that after server restarts ColdFusion doesn't have to recompile your .cfm/.cfc files.

    What you need to be aware of however, is that if you are in the situation where you have a LOT of ColdFusion files/applications, this adds up to a lot of class files in the /cfclasses directory. We could be talking thousands, and potentially even tens of thousands.

    Where the problem arises is that when ColdFusion restarts and looks in /cfclasses, it may not find it and then have to recompile the ColdFusion file and then save it to disk. This can result in a lot of disk I/O as well as time spent searching the directory for the specific file.

    In these circumstances you are in fact better leaving the option disabled as the compile time will actually be quicker than the File I/O and search. Of course, the best way to find out which performs best is to test, test and test again.

    As an aside, the Save Class Files was a real must for CFMX6.0 because the compiler that was used was ridiculously slow. With CFMX6.1 the compiler changed dramatically hence why Save Class Files isn't necessarily the best way to go.

    Co-incidentally, Macromedia.com has the option disabled.

    Hope that made sense?

    Andy