Railo Blog
- February 6, 2012
- Railo Tip of the Week: Installing SSL Certificates
As of Railo 3.3.2.001 you can install external SSL certificates of sites you want to access using CFHTTP and CreateObject(“webservice”).
This is done by simply going to the Railo Server Administrator on your server, looking on the left menu for “SSL Certificates” and putting in the site you want to add the certificate you want to use (for example somesite.com) and installing that certificate.
This means you can now do something like the following:
rs = CreateObject("webservice", "https://localhost/RemoteService.cfc?wsdl") dump(rs.getTime());This will now use the certificate you installed to communicate with that server.
- January 30, 2012
- Railo Tip of the Week: Railo Resources
Since Railo 2.0, it is possible to use all different kinds of virtual file systems with all different kind of file related tags. Railo supports the following virtual file systems:
- file (file:// or c:\ or /var/…)
- ram (ram://)
Note that you can store the location for the RAM resource to any external cache or NoSQL key value store) - ftp (ftp://username:password@ftpserver/)
- db (db://datasourcename:/)
- http (http://fileLocation)
- ZIP (zip://pathToFile!directory/file)
- TAR (tar://pathToFile!directory/file)
- TGZ (tgz://pathToFile!directory/file)
- S3 (s3://secret:access@amazonaws.com/bucket)
When you want to use a given resource you can easily do it by using the following notation:
<cffile action="read" file="db://datasource/temp.txt" variable="susi"> <cfdirectory action="read" directory="ram://" name="susi"> <cfif fileExists("ftp://username:password@ftpServer/index.cfm")>...</cfif>In addition you can easily define any resource as a mapping pointing to that resource. So you then can use these mappings inside your code.
- January 23, 2012
- Railo Tip of the Week: Query Cache
If you are using the query cache and you would like to flush the cache you can use the tag <cfobjectcache action = "clear"> in order to do so. The problem here is that this call flushes the complete cache which is a waste. In Railo you can use some additional attributes like filter, filterignorecase, and result.
The attributes filter and filterignorecase allow you to flush objects from the cache that match the filter. The filter gets applied like the sql statement LIKE. So if you use the following tag:
<cfobjectcache action="clear" filter="susi">
Then all elements in the query cache that are containing the string susi are flushed from the cache. This means you can easily remove all queries for a certain table if a table is updated on the database. The attribute filterignorecase does the same without obeying the case.
The next new attribute Railo has introduced is result which can be used with the new action size. If you execute the following tag:
<cfobjectcache action="size" result="cachesize">
the variable cachesize will contain the number of elements in the cache.