How to configure database caching based on update schedule

I am using an external data source for one of my applications. This database is updated every night, but after updating it is static. (AWS, Redshift, PostgreSQL).

In ColdFusioin, I cached some of the requests in my application for short periods of 30 minutes, so that everything works faster. But I have to think if the database is not updated, but on a daily basis, can I do something like the cachedAftercurrent date of 8:00 or something like that? Then every day at 8:00 a.m. the cache is cleared?

As far as I understand, it will cache requests only if they exactly match. But it is unclear something like this:

SELECT * WHERE a = <cfqueryparam value="#ARGUMENTS.a#" cfsqltype="cf_sql_int" />

If the value achanges in the arguments, CF is smart enough to treat it like another request, right? The docs say that it will only cache if the request is the same, but does this mean that the same setting or the same includes parameter values?

If this is true, it seems reasonable to just cache all requests at a specific time every day. I get huge performance gains because the Redshift database is fast, so some of these larger queries require processing time. What pitfalls can I face with this?

+4
source share

Source: https://habr.com/ru/post/1651697/


All Articles