[ic] [timed-build] - search pages
Mike Heins
interchange-users@interchange.redhat.com
Fri Feb 1 08:59:01 2002
Quoting Kevin Walsh (kevin@cursor.biz):
> > I read the info on the [timed-build] tag, and it seems to be what I need. I
> > have a several complex searches which need to be "cached" so they don't have
> > to query the database each time they're called up. Unfortunately, the
> > [timed-build] tag seems to build the results.html page, and any time that
> > results page is called, regardless of which query is being run, it shows the
> > same contents. Is there any way to accomplish the same type of work as the
> > [timed-build] tag, only using it in a search results page that will have
> > several separate searches run on it, which need to be saved?
> >
> You really don't want to wrap the [timed-build] tag around your
> results.html page for a number of reasons.
>
> As you have found, [timed-build] will write its interpolated body to
> the specified file and then read from that file the next time it is
> called (until the specified timeout expires) saving the time it takes
> to read from the database and interpolate again.
>
> The results.html page will be called to display the results of your
> customers' searches, most of which will differ, so you don't want
> the first set of results to be cached in this way.
>
> You could make up a filename from the search parameters and read/write
> that, but that won't work for searches that span multiple pages.
>
You can, however, do:
[timed-build
file="[cgi param 1].[cgi param 2]"
minutes=10
]
[query ....]
[/query]
[/timed-build]
[timed-build
file="[cgi param 3].[cgi param 4]"]
minutes=10
]
[query ....]
[/query]
[/timed-build]
If there is static query, i.e. the parameters are hardcoded,
you can do:
[timed-build auto=1 minutes=10]
Something unique...
[/timed-build]
There is an example in the vertical_category component in foundation.
--
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH 45013
phone +1.513.523.7621 <mheins@redhat.com>
Research is what I'm doing when I don't know what I'm doing.
-- Wernher Von Braun