• Resolved Meaple

    (@meaple)


    Good evening,

    I’ve been looking for a solution that will allow me to easily place css and js files on to a GCP Storage bucket which is hooked up to Cloud CDN. This plugin almost does this but falls short as it appears the plugin is expecting files in wp-content/cache/fvm directory. The reason for looking for such a solution is because my WordPress site is hosted within App Engine standard environment and plugins cannot write to any directory.

    When I installed the plugin I received an error with something like “Cannot modify header: <directory_link_to>/functions-cache.php: line 148. I sort of found that it is related to the plugin not being able to create or manage anything within wp-content/cache/fvm. I created this directory (had to create an index.php file with a comment) and deploy it out to App Engine. The error disappeared and the plugin seemed to be working to some extent. The plugin was picking up my default GCP Storage bucket location and would apply it and create the folder structure required (gs:<bucket_name/cache/fvm/<cachefolder>/out) but it was not placing any files in any directory. I tried to disable all options and start from scratch but nothing was working so I’ve had to disable the plugin.

    I do have the plugin WP-Stateless installed with fvm active. WP-Stateless allows me to manage my media uploads in a GCP Storage bucket and is something I do not want to disable. I did disable this plugin but fvm did not work as described above.

    I have looked at the FAQ of fvm but there’s nothing that notes its compatibility with GCS. I did look at the repo on Github and there’s nothing there either.

    In a nutshell, I would like to do everything that WP-Stateless does but with css, js and font files. It almost does but does not quite get there.

    Wordpress Version: 5.1-en_GB
    FVM Version: 2.6.0
    WP-Stateless Version: 2.2.3

Viewing 1 replies (of 1 total)
  • Plugin Author Raul P.

    (@alignak)

    Hi,

    I know what you mean, but the alternatives are not very good.

    a) Mount a storage bucket on your server, then adjust the cache location on FVM settings.
    https://cloud.google.com/compute/docs/disks/gcs-buckets#mount_bucket
    https://cloud.google.com/storage/docs/gcs-fuse
    (Warning… it will be slower than normal disk, but it’s stateless)

    b) Shift the load from static files to the database and PHP… I would need to rewrite FVM to do this, however I am not planning on doing it for a few reasons.

    I created FVM because at that time, most plugins were doing what you need. They were putting all the work on the database and serving it with PHP.

    That overloads the database and PHP doesn’t scale well to serve the CSS and JS files. Furthermore, TTFB would be high… and one of the features of this plugin, precompressed gzip and brotli files would not be useable.

    Of course, we could bypass the database and have REDIS instead, but serving the files with PHP would still be slow. A CDN would help in that case, but we are already entering the field of customization for your specific needs (I recommend you hire a developer for that).

    So in short, you need a writing mount point somewhere where plugins can write stuff.
    It doesn’t matter if it’s an NFS, NAS, bucket or whatever, as long as it’s writable and you adjust the settings on the plugin to make use of it.

    I suggest looking into wordpress repository and look for all the minification plugins, then test to see if any still does that.

    Thanks,

    Raul

Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion/New Feature: Plugin to work with WordPress on App Engine and Storage’ is closed to new replies.