Well, I have to take that back. I was positive it was caching, but now I can't seem to make it do so. But it still reads the style info properly.
Using Firebug to view my NET activity show that the cfm style sheet is reloaded every time even after turing on Coldfusion caching. I added a call to a second static style sheet ending in the normal .css and Firebug returns 304 not modified status for the .css style sheet. So, I can generate a dynamic style sheet and link to in as style.cfm but the browser won't cache it. Even tried to trick it with this <link href="style.cfm?.css" rel="stylesheet"> and it won't stick in the browser cache. Wil Genovese One man with courage makes a majority. -Andrew Jackson A fine is a tax for doing wrong. A tax is a fine for doing well. On Jan 21, 2009, at 9:12 PM, Wil Genovese wrote: > Adrian, > > I had to test this since this is something I wanted to do for > generating style sheets from users preferences saved in a DB. > > I can get the style sheet to cache using cfheader. I also used > cfcontent to set the text/css content type so as far as the browser > knows it has received nothing unusual. Here is some very simple code. > > index.cfm > ----------- > <cfsetting showdebugoutput="false"> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd > "> > <html> > <head> > <title></title> > <link href="style.cfm" rel="stylesheet"> > > </head> > <body> > <div class="red">This is a test of the CFM Style. It is works this > will be bold read text.</div> > > > </body> > </html> > > style.cfm > ----------------- > <cfsetting enablecfoutputonly="true" showdebugoutput="false"> > > <cfsavecontent variable="myStyles"><cfoutput> > ..red { > color: red; > font-weight: bold; > } > ..blue { > color: green; > } > </cfoutput> > </cfsavecontent> > > <cfheader name="Expires" value="#dateadd("n",5,now())#"> > <cfcontent type="text/css"><cfoutput>#myStyles#</cfoutput> > > > > > Wil Genovese > > One man with courage makes a majority. > -Andrew Jackson > > A fine is a tax for doing wrong. A tax is a fine for doing well. > > On Jan 21, 2009, at 10:54 AM, Adrian Lynch wrote: > >> I've done it in the past and it's never been a problem, but I'm >> wondering if >> there is ever a reason not to have the following: >> >> <link type="text/css" rel="stylesheet" href="a-cf-page.cfm" /> >> >> Do any browsers complain that it's not a .css file? >> >> I think it'll be ok but does anyone know different? >> >> One downside, opening a .cfm page in the IDE, you might not get the >> syntax >> highlighting etc. >> >> I suppose the same question goes for scripts too. >> >> Adrian >> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318299 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

