Caching a .net user control Options
John C Scott
Posted: Monday, October 20, 2008 11:14:50 PM

Rank: Newbie

Joined: 10/20/2008
Posts: 4
Location: Frome, Somerset, UK
We generate a graphic with GDI that updates a count down 4 times a day, and this appears in the banner on every page of our site. This site will take a fairly high number of hits and so I'm trying to make everything as efficient as possible. Generating the image on every request seems a waste. Presently the image is generated in an ascx web user control.

I saw a warning not to use .net caching with a user control used by Umbraco, what would be the best approach to this problem?
John C Scott
Posted: Tuesday, October 21, 2008 7:39:09 PM

Rank: Newbie

Joined: 10/20/2008
Posts: 4
Location: Frome, Somerset, UK
ok so generating it with GDI+ was a terrible idea
now we generate it as text and use CSS to make it graphical, and then it degrades nicely too
and as far as I can see i can cache the ascx as a macro in the developer tab of the umbraco control panel - for my purposes i will uncheck both by page and by person as it is the same for every page and person and as it updates four times a day then the number of seconds can be quite high
though I am thinking why not go for five minutes (300) as I can't think of any advantage in caching any more than that
is this the right approach?
sorry for being all newbie about it - but wow what a great product - my first ten umbraco days have been the best 10 days of new product ever - really loving it
drobar
Posted: Tuesday, October 21, 2008 8:15:43 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Hi John, and welcome to umbraco!

I think you've got the right solution now. That approach should work beautifully.

If you do need to make a graphic of your text rather than just css'd, you might find ImageGen helpful. Very easy to use with umbraco, caches the output, lots of options and full docs. You can get it (and the docs) from the Package Repository or from http://www.percipientstudios.com/imagegen.aspx

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.