Detecting Page Changes

I’m trying to figure out a way to track whenever a given page’s rendered
output may have changed.

Kind of tricky since changing the layout or, worse yet, a snippet could
change the page’s output. And then, of course, there are those silly
extensions people keep making :smiley: with all their dynamic tags.

Does anyone have any clever suggestions to deduce that the page’s output
may
be changed? I’d love to have an event (or set of events) to trigger the
check but would settle for a smart polling solution (but it should scale
well).

BTW, I’d love to be able to “know” that the page had changed but, for my
purposes, even being able to suspect it’s guilt would be sufficient.

View this message in context:
http://www.nabble.com/Detecting-Page-Changes-tf4603945.html#a13145924
Sent from the Radiant - User mailing list archive at Nabble.com.

I’m trying to figure out a way to track whenever a given
page’s rendered
output may have changed.

I was doing some thinking about this recently, but haven’t had a go at
implementing yet.

My basic idea was:

Add a listener that hooks into after_initialize on page, snippet and
layout.

Hook into SiteController - reset the listener before rendering the page,
and then read out the list of accessed objects after the
render is complete and dump that list to the db.

Have a listener that hooks into after_save on page, snippet and layout.
Read the list of urls that accessed that object and clear
them all - for pages also clear anything that has accessed the parent
page.

This should give pretty much complete coverage for pages with content
that depend only on db changes. Any content that is time
sensitive though, you’ll have to have some other mechanism for.

Dan.

I’m trying to figure out a way to track whenever a given page’s
rendered output may have changed.

Just curious, what functionality do you want to achieve with this?

/AITOR

I wish there was a per page cache time property. That way dynamic
pages had shorter cache times. Perhaps tags on page would adjust the
cache time setting for the page.

That way proper cache expiration times could be reported back to the
browser and components like yours could get an idea of how dynamic the
page content is.

On 10/14/07, Chris P. [email protected] wrote:

validation (passed, failed, unknown, etc). That way I could present a
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant


Regards,
Hiram

Blog: http://hiramchirino.com

I wish there was a per page cache time property. That way dynamic
pages had shorter cache times. Perhaps tags on page would adjust the
cache time setting for the page.

Just set response.cache_timeout (to a value in seconds) from your
page model.

Dan.

Aitor Garay-Romero wrote:

I’m trying to figure out a way to track whenever a given page’s
rendered output may have changed.

Just curious, what functionality do you want to achieve with this?
I am building a validator extension - I’ll announce v0.1 here shortly.
Initially, it will retain no memory of the tests - you just run it on a
page to validate the markup and get handed the result.

In future versions, however, I’d like to store the results of the
validation (passed, failed, unknown, etc). That way I could present a
report/view to the users showing which pages been validated (and their
results) and which haven’t.

As you’ve probably guessed, if I want to store whether the page is
valid, I need to know if a page has changed so that I can change its
status as ‘unknown’.

-Chris

I wish there was a per page cache time property. That way dynamic
pages had shorter cache times. Perhaps tags on page would adjust the
cache time setting for the page.

Just set response.cache_timeout (to a value in seconds) from your
page model.

Dan.