Welcome Guest, Not a member yet? Register   Sign In
Conditional caching
#1

[eluser]Unknown[/eluser]
Hi there,

I have a collection of large XML files that my website parses and displays. Since these files are large and DOM reading is more expensive than I'd like, I thought I would implement a cache to hold processed results. These files will only have to be updated when the XML file itself is updated.

For that reason, I want to implement a sort of "conditional cache":

Code:
if (/* XML file timestamp is newer than cache file timestamp */) {
    /* parse as necessary */
} else {
    /* show the cache file and exit */
}

I've done this sort of thing with "regular" PHP before, but I'd like to try to work within the framework as much as possible. Is it possible to produce this sort of behavior with CodeIgniter's native functions?

Thanks for reading!

(edit: cleaned up a sentence)




Theme © iAndrew 2016 - Forum software by © MyBB