I see that the prefix setting is getting applied in Cache.php - including default prefix for all specific settings which is good.

However i've tried to understand if prefix gets applied correctly for the current install.

i see

    $this->lookup = $this->prefix . $this->name . '_lookup';
    $this->lock = $this->lock_dir . '/' . $this->prefix . $this->name . '_lock';

leading to something like this when outputting.

prefix-cache_lookup
/tmp/prefix-cache_lock
prefix-cache_views_lookup
/tmp/prefix-cache_views_lock
prefix-cache_filter_lookup
/tmp/prefix-cache_filter_lock
prefix-cache_content_lookup
/tmp/prefix-cache_content_lock
swdx-cache_menu_lookup
/tmp/prefix-cache_menu_lock

Now see - the lock is in /tmp/ - but we've used a configuration with 'path' => '/my/custompath'
The path gets only applied in fileCacheRouterEngine and not for the lock.

I'd have expected to be able to set the same path for two instances but have a separation because of setting a prefix.
(so i'd expect to have prefix as e.g. a basepath/subfolder in the path tree)
Also i'd have expected to see the path settings apply in _lock vars.

Since i can't find those things documented in any location (i was looking for) i hope someone can answer me.

Comments

miro_dietiker’s picture

Title: file engine and prefix » file engine path and prefix settings

changing title - topic is settings of path and prefix

andypost’s picture

This should be changed to be used only for file engine

miro_dietiker’s picture

Having two drupal installs with different path settings and without specific prefixes now leads to shared lock files in /tmp.

I'm not yet fully sure the prepending hash of a filename really contains the prefix name. So another clash in namespace might be the filenames too (if you decide to use the same path and different prefixes).

If this is illegal then it needs clear documentation.

andypost’s picture

File locking should gone from base implementations! slantview planned to roll back this but not done still...

I think we should setup only common params in base class so engines must care about own variables itself.

This way seem more self documented and clean.

miro_dietiker’s picture

It seems to mee this still needs to be added after #578522: File engine: Performance, filenames, and other cleanup