pThumb
pThumb copied to clipboard
Caching outside of MODX
When trying to harden a MODX installation, I like to put "manager", "core" etc. on one (sub)domain and the website(s) on another. Like this:
/htdocs
/modxadmin.mysites.tld << MODX CMS lives here
/myothersites.tld
/www << This is one of many sites driven by one MODX
/subdomainZ << This is one of many sites driven by one MODX
/another-domain.tld << This is one of many sites driven by one MODX
/some-website.tld << This is one of many sites driven by one MODX
This way I can easily update MODX (everything stays together) and every website/subdomain is stored separately in its own folder: index.php
, /assets
, config.inc.php
, .htaccess
. Done.
But pThumb does not like this layout: "pThumb Cache Location: The directory to store cached images. The path is relative to the MODX base directory, which is generally your web root."
This leads to the problem, that the thumbs are generated and stored in the MODX root dir and cannot be accessed from the "outside". The only way (i found) to solve this is by using symbolic links (on Linux) and build a tunnel through the filesystem to reach a cache folder. This works but is somehow not elegant ;-) – and not maintainable via MODX itself.
Is there a way of telling pThumb that the cache is "outside" the modx-root – just somewhere on the server?
If pthumb.ptcache_location
would be an absolute path life would be even better. Maybe there could be a "relative/absolute" switch like the is with Media Sources. Then everybody could decide where the cache is stored – and the setting could be altered for every context.
What do you think of the idea of absolute cache-paths?
I've come up against this issue before as well. This is a great idea and would make pthumb so much more flexible!
@mindeffects @davidpede I'm pretty sure when pthumb.use_ptcache
is false
, it uses the full absolute path provided in phpthumbof.cache_path
. Does that meet your needs, or you are specifically looking to do this with pthumb.use_ptcache
setting as true
?
I think it would be better if the pThumb cache could use an absolute path tbh
Thanks for your replay, @sepiariver. It has bee a while since I struggled with this problem, so I will have to dig up this project where I needed this. Da brain ...
In general I am not a fan of a "fallback with settings in another namespace"-solution since it makes thing a little complicate to handle – having not everything in one place.
A rel/abs switch for pthumb.ptcache_location
would be great because with multidomain installs and sites in different folders, the "MODX base directory" is somehow difficult to handle. So I am agreeing with @davidpede here.
Is any of you a "code digger"? Since I am not really one. ;-)
Ok I'll look into adding this. Thanks for the input, @mindeffects @davidpede
+1
+1