Non-static page parts

I’ve written an extension (which I can clean-up and release at some
point if there’s interest) that allows for uploading and cropping
header images, and then includes a partial in the page editing
interface that allows for selection of header images for particular
pages. My problem is that my client wants multiple header images per
page, which should change each time the page is loaded. While this is
not difficult from a ruby perspective, the caching system makes this
ineffective; though the radius tag that gives the current page’s
header image url rotates through all of the images for that page, it
will actually only change whenever the cache expires.

Is there any way—short of turning off caching entirely—to make this
work in Radiant? I was thinking something along the lines of being
able to set a particular page part as non-static, so that the rest of
the page is just pulled from the cache, but that part is rendered at
run-time.

Any help would be greatly appreciated.

Micah Wylde wrote:

I’ve written an extension (which I can clean-up and release at some
point if there’s interest) that allows for uploading and cropping
header images, and then includes a partial in the page editing
interface that allows for selection of header images for particular
pages. My problem is that my client wants multiple header images per
page, which should change each time the page is loaded. While this is
not difficult from a ruby perspective, the caching system makes this
ineffective; though the radius tag that gives the current page’s
header image url rotates through all of the images for that page, it
will actually only change whenever the cache expires.

Why not load one image by default and if javascript is enabled load a
random one with javascript?


John L.
http://wiseheartdesign.com

That is a potential solution, and one that I’ll probably resort to if
a better one can’t be found; however, I’d rather not limit this to
people who have javascript enabled.

Is there any way-short of turning off caching entirely-to make this
work in Radiant? I was thinking something along the lines of being
able to set a particular page part as non-static, so that the rest of
the page is just pulled from the cache, but that part is rendered at
run-time.

It’s banner advertising 101 - people have had random banners in static
html for a long time.

Let the page be cached. Have the url of the header image constant.
Have a radiant page/some other form of dynamic thing at that url that
redirects to a random url.

Dan.