• Resolved smcavoy

    (@smcavoy)


    Hello,

    I’m looking to get caching working for a new post page. The caching works well in the Pantheon Development environment (I can see the attachment_xxxx.txt files being created). I’ve had to move the cache directory to uploads/cache, since Pantheon does not allow write access to anything but the uploads directory. In the Pantheon Dev site, it works fine. In the Pantheon Test site, the new cache and log directories are being created but the attachment files are not begin created. I assume this has to do with permission differences between the Pantheon Dev and Test sites. Other than moving the logs and cache directories (via updates to the app.php file), is there any other config changes I could try to make the cache files write? Unfortunately, there are no logs being written as well so it’s hard to figure out if I’ve missed another config change possibly.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor 10Quality

    (@10quality)

    The attachment files are created by WordPress, the CMS manages those files under the uploads folder.

    As far as the configuration goes, the cache folder is located at config/app.php file, as you mentioned, the only issues is that your configuration will be override when updated.

    Will add to our work queue a hook to solve this in the future.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi!

    Wanted to pass along this page in case it may provide some guidance as well: https://pantheon.io/docs/assuming-write-access

    The Dev environment can be switched from SFTP to Git but Test and Live are read-only.

    Plugin Contributor 10Quality

    (@10quality)

    Please update to version 2.3.9 and add the following customization hooks to your WordPress setup:

    
    /**
     * Replace cache folder.
     * @hook wpmvc_cache_config
     * 
     * @param array $cache
     * 
     * @return array 
     */
    add_filter( 'wpmvc_cache_config', function( $cache ) {
        $uploads = wp_get_upload_dir();
        $cache['path'] = str_replace( $uploads['subdir'], '', $uploads['path'] ) . '/wpmvc/cache';
        return $cache;
    } );
    
    /**
     * Replace logs folder.
     * @hook wpmvc_log_path_config
     * 
     * @param string $path
     * 
     * @return string 
     */
    add_filter( 'wpmvc_log_path_config', function( $path ) {
        $uploads = wp_get_upload_dir();
        return str_replace( $uploads['subdir'], '', $uploads['path'] ) . '/wpmvc/log';
    } );
    

    This will change the path in which the cache and log files are stored by default, changing theme to a location inside the uploads directory.

    If you are not sure on how to customize your WordPress or add these hooks, please read this article.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post Gallery with Pantheon Host’ is closed to new replies.