compile cfm files

427 views
Skip to first unread message

computer...@gmail.com

unread,
Dec 9, 2016, 10:48:13 AM12/9/16
to Lucee
Hi,

Looking for a way to pre-compile all my application's cfm files. I've tried going to Archive & Resources --> Mappings, created a virtual  to the "/", I pointed the resource to my application's file location and then I went into the mapping, cleared stop on error and hit the compile button. I looks like it does something but then i can't for the life of me find where the compiled files are. I looked under /webapps/ROOT/WEB-INF/lucee/cfcclasses but they are not there. I even went to /var/www/WEB-INF/lucee/cfclasses and they are not there either.

I'm running Lucee 4.5.2.018 final under Linux.

I would appreciate some help on this.

Thanks


computer...@gmail.com

unread,
Dec 12, 2016, 1:01:12 PM12/12/16
to Lucee
anyone?

Mark Drew

unread,
Dec 12, 2016, 1:04:41 PM12/12/16
to lu...@googlegroups.com
What are you trying to compile them to? You can compile a mapping (and use the <cfadmin> tag for this) 

You can use that compiled mapping in your application. Is this the goal? 

Regards


Mark Drew


develop • deploy • deliver

-- 
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/17c8657a-349c-424e-b78d-99a6a7157be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

computer...@gmail.com

unread,
Dec 12, 2016, 2:53:19 PM12/12/16
to Lucee
I'm trying to compile each .cfm file into compiled versions of themselves. I know that as each page of the application gets accessed, Lucee creates a a compiled version of that file under /var/www/WEB-INF/lucee/cfclasses. So for example, if I accessed a page called test.cfm, it would create a file called test_cfm$cf.class in the directory.  What I want to do, is to pre-compile if you will all the files in my application without having to access each and every page.

Igal @ Lucee.org

unread,
Dec 12, 2016, 3:10:01 PM12/12/16
to lu...@googlegroups.com

Try:

    getPageContext().compile(path);


Igal Sapir
Lucee Core Developer
Lucee.org

computer...@gmail.com

unread,
Dec 12, 2016, 3:14:18 PM12/12/16
to Lucee
Can you elaborate more on that? How would I use that?

Risto

unread,
Dec 12, 2016, 5:12:56 PM12/12/16
to Lucee
Once your pages are accessed couldn't you then go into settings>performance and set it to never inspect the templates and have the same effect?

If you have access to Coldfusion and your code runs fine on coldfusion and Lucee, I wonder if you can just use cfcompile or cfencode? Then dump the files back in the cfclasses directory.

Mark Drew

unread,
Dec 13, 2016, 5:26:25 AM12/13/16
to lucee
Here is an example file, 



Basically you can compile a single file at a time. I would actually suggest you create a mapping and an archive so that you can use that, which is more portable. This code would be good to warm up a server. 

Regards

Mark Drew


develop • deploy • deliver

Harry Klein

unread,
Dec 14, 2016, 3:28:10 AM12/14/16
to Lucee
Thanks a lot for your example Mark!

-Harry

Mark Drew

unread,
Dec 14, 2016, 3:31:24 AM12/14/16
to lu...@googlegroups.com
+1

Nice refactor. 

Mark Drew
- Sent by typing with my thumbs. 
Reply all
Reply to author
Forward
0 new messages