Took these at home because I needed to shoot something and couldn’t think of any thing else. Though “Morning Ritual” is a little laughable if you have seen my face since the 7th grade.



After reading some about embedding fonts I decided to try my hand at embedding fonts in CSS using ColdFusion. I was pretty pleased with the result. This will not work in IE since Microsoft chooses not to recognize the @font-face property in CSS, for more information on a possible work around for that I recommend reading Jon Tan’s post. I think the hard part of this right now is finding the right font with the right usage license.
Example (Sorry IE…)
The quick brown fox jumps over the lazy dog
Since this is wordpress I used an external style sheet, the code in which is pretty simple.
Code
<cffile action="readBinary" file="#expandPath('./IDAutomation.otf')#" variable="myBinaryFile">
<cfset myFont = toBase64(myBinaryFile)>
<cfcontent type="text/css" reset="yes">@charset "utf-8";
/* CSS Document */
@font-face {
font-family: "IDAutomation";
src: url("data:font/opentype;base64,<cfoutput>#myFont#</cfoutput>");
}
.barcode {
font-family: "IDAutomation", serif;
}

I have long said that the fictional Simpsons Springfield is where I live. Just one more real life event to prove it.
I recently had the need to do some client side file caching for static files and images. Not usually a problem, just setup IIS to expire after X days for that directory. But for this site profile images were stored in the database, so coldfusion would have to control the cache headers on image render.
I attached the code for imageRender.cfm which adds two headers
< cfheader
name="Expires"
value="#GetHttpTimeString(dateadd('d', 30, Now()))#"
/>
< cfheader
name="Last-Modified"
value="#GetHttpTimeString(qry_imageRender.lastModified)#"
/>
The render page then does a check to see if the file has been modified before it outputs the file to the client and if it can sends a not modified header. This saves quite a bit of server traffic and as a result lowers the load time for a typical page view on the site.
This could work for any type of page but especially helpful when serving images or other large static files. Hope this helps someone, as most of my initial google searches showed how to not cache a script.