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

Autooptimize and App Engine / Cloud Storage #187

Open
mshick opened this Issue Sep 10, 2018 · 5 comments

Comments

2 participants
@mshick

mshick commented Sep 10, 2018

Building on #136 here: I've been working out an App Engine deployment of Wordpress. Autoptimize has a couple of remaining issues that I've seen:

  • LOCK_EX is not supported with the Cloud Storage library, and will throw errors.

  • AUTOPTIMIZE_CACHE_DIR as utilized generates inconsistent, unwritable paths, due to a lack of normalization of the trailing slash. There are several places where filepaths are appended that presume a trailing slash, and others that presume a lack of a slash. The GCS library will not accept a poorly formed path like gs://my-bucket/cache//index.html.

I've monkey patched my plugin to deal with these details and it seems to write and read correctly. However, the excessive about of "snippet" checking I'm seeing leads to AO creating hugely inefficient renders. Turning the plugin on jacks a page render up from 2-3s to about 10s, and seems to confound batcache...

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 10, 2018

Owner
Owner

futtta commented Sep 10, 2018

@mshick

This comment has been minimized.

Show comment
Hide comment
@mshick

mshick Sep 10, 2018

@futtta thanks for getting back. Great to hear about the new release. I will test it out.

  • The snippet logic slowness — yes, I do think it's from the slowness of the gs:// filesystem. I've disabled minification and am seeing more sane renders now.

  • The batcache was a mistake / misread on my end.

  • One thing you might want to consider — when using the gs:// filesystem, I found I needed to manually gzip the files and set the metadata appropriately to contentEncoding: gzip. This allows Cloud Storage to serve the files more efficiently. Not sure how specific to Cloud Storage you want to get though.

mshick commented Sep 10, 2018

@futtta thanks for getting back. Great to hear about the new release. I will test it out.

  • The snippet logic slowness — yes, I do think it's from the slowness of the gs:// filesystem. I've disabled minification and am seeing more sane renders now.

  • The batcache was a mistake / misread on my end.

  • One thing you might want to consider — when using the gs:// filesystem, I found I needed to manually gzip the files and set the metadata appropriately to contentEncoding: gzip. This allows Cloud Storage to serve the files more efficiently. Not sure how specific to Cloud Storage you want to get though.

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 10, 2018

Owner
Owner

futtta commented Sep 10, 2018

@mshick

This comment has been minimized.

Show comment
Hide comment
@mshick

mshick Sep 11, 2018

Hi there, I did. Unfortunately if you gzip the file and dump to Cloud Storage with the .gz extension you don't have the benefit of rewriting the path to return the gzipped version at the standard resource url.

Do you have a filter that would allow me to append .gz to autoptimized URLs that should be served from a CDN host (the Cloud Storage bucket URL in this case)?

mshick commented Sep 11, 2018

Hi there, I did. Unfortunately if you gzip the file and dump to Cloud Storage with the .gz extension you don't have the benefit of rewriting the path to return the gzipped version at the standard resource url.

Do you have a filter that would allow me to append .gz to autoptimized URLs that should be served from a CDN host (the Cloud Storage bucket URL in this case)?

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 11, 2018

Owner
Owner

futtta commented Sep 11, 2018

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