Welcome Guest, Not a member yet? Register   Sign In
Cache Functions Suggestions
#35

[eluser]TheFuzzy0ne[/eluser]
Perhaps I am way out of my depth here, but please bear with me, and let me know if I have overstepped my boundaries.

Why not follow a process similar to this.

There can be a subdirectory within the cache directory - I will call it "tmp" for the sake of simplicity.

The cache class could check the tmp directory first, for the cache file it needs. If it's in there, then that file is rendered. If it's not, then the file is read from the cache directory.

A file is copied over to the tmp directory when the cache is being updated in the cache directory. Once the file has been cached in the cache directory, the file in the tmp directory can be deleted, so the cache is then pulled from the newly cached file.

The only problem I can see here is that there may be race conditions which need to be ironed out, but the idea is very simple, and I feel it can work. What's more, you don't even need to bother with locking the file that's being written to, as it's not even looked at so long as the copied file exists in the tmp directory. The cache file in the tmp directory is being read from and rendered even before the original file is written to, and continues to be read from until it's deleted shortly after the main cache file has been written.

Now I know you guys are a bunch of tech-heads, and I'm sure my idea is flawed somewhere, but in my mind, I can't see how. If that is the case, could someone please explain what I'm missing (or just tell me to shut up and go away). Big Grin

Another suggestion would be to allow database caching as an alternative. I'm not sure how much more/less efficient it could be, but I am sure it's doable. Obviously, I'm not saying scrap the disk caching, but rather, it could be an alternative.

Thanks.


Messages In This Thread
Cache Functions Suggestions - by El Forum - 02-01-2008, 04:35 PM
Cache Functions Suggestions - by El Forum - 02-08-2008, 03:11 AM
Cache Functions Suggestions - by El Forum - 02-08-2008, 07:45 AM
Cache Functions Suggestions - by El Forum - 02-11-2008, 03:26 PM
Cache Functions Suggestions - by El Forum - 02-11-2008, 04:24 PM
Cache Functions Suggestions - by El Forum - 02-12-2008, 09:56 AM
Cache Functions Suggestions - by El Forum - 02-12-2008, 10:49 AM
Cache Functions Suggestions - by El Forum - 02-12-2008, 11:00 AM
Cache Functions Suggestions - by El Forum - 02-12-2008, 09:51 PM
Cache Functions Suggestions - by El Forum - 02-13-2008, 03:54 PM
Cache Functions Suggestions - by El Forum - 02-13-2008, 04:35 PM
Cache Functions Suggestions - by El Forum - 02-13-2008, 06:51 PM
Cache Functions Suggestions - by El Forum - 02-14-2008, 04:00 AM
Cache Functions Suggestions - by El Forum - 02-14-2008, 11:58 AM
Cache Functions Suggestions - by El Forum - 02-15-2008, 08:48 AM
Cache Functions Suggestions - by El Forum - 02-15-2008, 08:55 AM
Cache Functions Suggestions - by El Forum - 02-15-2008, 09:02 AM
Cache Functions Suggestions - by El Forum - 02-15-2008, 05:50 PM
Cache Functions Suggestions - by El Forum - 02-15-2008, 06:19 PM
Cache Functions Suggestions - by El Forum - 02-15-2008, 06:34 PM
Cache Functions Suggestions - by El Forum - 03-08-2008, 10:23 AM
Cache Functions Suggestions - by El Forum - 03-13-2008, 08:20 PM
Cache Functions Suggestions - by El Forum - 03-13-2008, 08:25 PM
Cache Functions Suggestions - by El Forum - 03-25-2008, 06:12 AM
Cache Functions Suggestions - by El Forum - 03-25-2008, 06:58 AM
Cache Functions Suggestions - by El Forum - 03-25-2008, 07:27 AM
Cache Functions Suggestions - by El Forum - 03-25-2008, 10:51 AM
Cache Functions Suggestions - by El Forum - 03-25-2008, 11:31 AM
Cache Functions Suggestions - by El Forum - 03-25-2008, 11:37 AM
Cache Functions Suggestions - by El Forum - 04-24-2008, 06:33 AM
Cache Functions Suggestions - by El Forum - 04-25-2008, 11:25 AM
Cache Functions Suggestions - by El Forum - 04-25-2008, 02:03 PM
Cache Functions Suggestions - by El Forum - 04-25-2008, 04:50 PM
Cache Functions Suggestions - by El Forum - 04-29-2008, 05:36 AM
Cache Functions Suggestions - by El Forum - 04-29-2008, 06:15 AM
Cache Functions Suggestions - by El Forum - 04-29-2008, 09:39 AM
Cache Functions Suggestions - by El Forum - 04-29-2008, 10:10 AM
Cache Functions Suggestions - by El Forum - 04-29-2008, 10:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB