Location of cache folder (was Re: [Habari-SVN] Re: [habari commit] r1099 - in trunk/htdocs: . system/admin system/classes)

78 views
Skip to first unread message

Geoffrey Sneddon

unread,
Nov 20, 2007, 6:17:26 PM11/20/07
to habar...@googlegroups.com, habar...@googlegroups.com

On 20 Nov 2007, at 23:12, Christopher Davis wrote:


On Nov 18, 2007, at 7:23 PM, codesite...@google.com wrote:

Author: epithet
Date: Sun Nov 18 16:22:00 2007
New Revision: 1099

Added:
 trunk/htdocs/system/classes/filecache.php
Modified:
 trunk/htdocs/index.php
 trunk/htdocs/system/admin/dashboard.php
 trunk/htdocs/system/classes/cache.php

Log:
Pass 1 at cache implementation.

Included FileCache implements file-based caching at system/cache.  It
needs to be created an writable, or nothing gets cached.

Dashboard gets a cache applied to the incoming links section.  See  
that
section of code to see the cache implemented.

FileCache does not yet implement _expire() or _extend().

I was wondering why we are saving cached items in /system/.  Other  
than the slightly uneasy feeling having a writeable dir in /system/  
gives me I don't really have any objections, just wondering why we  
were using /user/.

I don't particularly like it being in /system either — where are user plugins meant to cache, for example? Making them cache in /system seems illogical. I personally would prefer creating a /cache folder, or, alternatively, creating a /files folder under which every web-server writeable file/folder exists.


--
Geoffrey Sneddon

Caius Durling

unread,
Nov 20, 2007, 6:24:22 PM11/20/07
to habar...@googlegroups.com
On 20 Nov 2007, at 23:17, Geoffrey Sneddon wrote:

I don't particularly like it being in /system either — where are user plugins meant to cache, for example? Making them cache in /system seems illogical. I personally would prefer creating a /cache folder, or, alternatively, creating a /files folder under which every web-server writeable file/folder exists.

I think /cache seems the most appropriate.  maybe have the following structure?

/cache
- content
- plugins

and then plugins can cache in /cache/plugins/<plugin_name>/ and the content is cached in /cache/content/.  Seems logical to me.

C
____________________________________

Caius Durling
UK Student -- +44 (0) 7960 268100
____________________________________




Owen Winkler

unread,
Nov 21, 2007, 1:19:13 AM11/21/07
to habar...@googlegroups.com
On Nov 20, 2007 6:24 PM, Caius Durling <nemo...@gmail.com> wrote:
>
> I think /cache seems the most appropriate. maybe have the following
> structure?
>
> /cache
> - content
> - plugins
>
> and then plugins can cache in /cache/plugins/<plugin_name>/ and the content
> is cached in /cache/content/. Seems logical to me.

Why do plugins need their own cache?

Owen

Robin Adrianse

unread,
Nov 21, 2007, 2:41:44 AM11/21/07
to habar...@googlegroups.com
I suppose it could be to avoid conflicts, but I think that it isn't necessarily necessary.

Christian Mohn

unread,
Nov 21, 2007, 4:53:02 AM11/21/07
to habar...@googlegroups.com

Why would there be conflicts? Why would there be a need to separate system and plugin caches? A cache is expendable, it’s doomed from the time it’s created and serves a temporary purpose by nature.

 

Also, the cache location is set via a static that could potentially be changed to use whatever path you want, or I guess a plugin could. Which makes sense as a plugin could potentially add other caching mechanisms beside filesystem.

 

As it is now, it’s dead simple to use, and requires next to nothing from plugin developers. It just works, that is after you create the directory and change permissions on it so that Apache can write to it.

 

While I might agree that system/cache might not be the best location from a user perspective, since the user would have to create and chmod the directory,  I really do not see why we should make it more complex my creating plugin subdirs etc. There is no need for that.

 

Christian

Christian Mohn

unread,
Nov 21, 2007, 5:51:25 AM11/21/07
to habar...@googlegroups.com

I’ve added a very small patch to issue 487 (http://code.google.com/p/habari/issues/detail?id=487 ) that enables logging if the cache directory is inaccessible. At least that provides a indication to the user that caching is not working and that the cache dir isn’t working.

 

Christian

 

From: habar...@googlegroups.com [mailto:habar...@googlegroups.com] On Behalf Of Robin Adrianse
Sent: 21. november 2007 08:42
To: habar...@googlegroups.com
Subject: [habari-dev] Re: Location of cache folder

 

I suppose it could be to avoid conflicts, but I think that it isn't necessarily necessary.

Matthias Bauer

unread,
Nov 21, 2007, 7:46:00 AM11/21/07
to habar...@googlegroups.com
On 2007-11-21 11:51 Christian Mohn wrote:

> I’ve added a very small patch to issue 487
> (http://code.google.com/p/habari/issues/detail?id=487 ) that enables
> logging if the cache directory is inaccessible. At least that provides a
> indication to the user that caching is not working and that the cache
> dir isn’t working.

Committed, thanks.

-Matt

Christian Mohn (h0bbel)

unread,
Nov 21, 2007, 8:31:00 AM11/21/07
to habari-dev
Excellent :)

On Nov 21, 1:46 pm, Matthias Bauer <moef...@moeffju.net> wrote:
> On 2007-11-21 11:51 Christian Mohn wrote:
>
> > I've added a very small patch to issue 487
> > (http://code.google.com/p/habari/issues/detail?id=487) that enables
Reply all
Reply to author
Forward
0 new messages