# Non-static page parts

**URL:** <https://www.ruby-forum.com/t/non-static-page-parts/115963>\
**Category:** Radiant CMS\
**Created:** [October 1, 2007, 1:31am UTC](https://www.ruby-forum.com/t/non-static-page-parts/115963 "2007-10-01T01:31:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micah\_Wylde](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@Micah\_Wylde](https://www.ruby-forum.com/u/Micah_Wylde)\
**Post date:** [October 1, 2007, 1:31am UTC](https://www.ruby-forum.com/t/non-static-page-parts/115963/1 "2007-10-01T01:31:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Micah\_Wylde](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@Micah\_Wylde](https://www.ruby-forum.com/u/Micah_Wylde)\
**Post date:** [October 1, 2007, 1:45am UTC](https://www.ruby-forum.com/t/non-static-page-parts/115963/2 "2007-10-01T01:45:15Z")

</div>

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](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Micah\_Wylde](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@Micah\_Wylde](https://www.ruby-forum.com/u/Micah_Wylde)\
**Post date:** [October 1, 2007, 1:48am UTC](https://www.ruby-forum.com/t/non-static-page-parts/115963/3 "2007-10-01T01:48:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Micah\_Wylde](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@Micah\_Wylde](https://www.ruby-forum.com/u/Micah_Wylde)\
**Post date:** [October 1, 2007, 1:57am UTC](https://www.ruby-forum.com/t/non-static-page-parts/115963/4 "2007-10-01T01:57:31Z")

</div>

> 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.
