Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching outside of MODX #35

Open
mindeffects opened this issue Apr 23, 2015 · 7 comments
Open

Caching outside of MODX #35

mindeffects opened this issue Apr 23, 2015 · 7 comments
Assignees

Comments

@mindeffects
Copy link

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?

@davidpede
Copy link

I've come up against this issue before as well. This is a great idea and would make pthumb so much more flexible!

@sepiariver
Copy link

@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?

@davidpede
Copy link

I think it would be better if the pThumb cache could use an absolute path tbh

@mindeffects
Copy link
Author

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. ;-)

@sepiariver
Copy link

Ok I'll look into adding this. Thanks for the input, @mindeffects @davidpede

@sepiariver sepiariver added this to the 2.4 next feature release milestone Mar 9, 2016
@muzzwood
Copy link

+1

1 similar comment
@jonleverrier
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants