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

"Deploy Cache 0 Paths in database" for GCS add-on #745

Closed
tpoindessous opened this issue Jan 15, 2021 · 12 comments
Closed

"Deploy Cache 0 Paths in database" for GCS add-on #745

tpoindessous opened this issue Jan 15, 2021 · 12 comments
Assignees
Labels

Comments

@tpoindessous
Copy link

Hi !

I'm using GCS add-on and on "caches" page, the result for Deploy Cache is always 0.

I looked in mysql db and in wp_wp2static_deploy_cache, I have 6300 lines .

A select gives me this :

select * from wp_wp2static_deploy_cache limit 1;
+----+----------------------------------+---------------------+----------------------------------+-----------------------------+
| id | path_hash                        | path                | file_hash                        | namespace                   |
+----+----------------------------------+---------------------+----------------------------------+-----------------------------+
|  1 | de5626a32cd74a40321a843bcfdc50d6 | /contact/index.html | 89088e44a5d25e5d0ee05b981e9aedab | wp2static-addon-gcs/default |
+----+----------------------------------+---------------------+----------------------------------+-----------------------------+

thanks !

@leonstafford
Copy link
Contributor

hmm, not familiar enough with the GCS one yet, sorry!

@john-shaffer any ideas?

@john-shaffer
Copy link
Contributor

This is the case with the S3 addon as well. I think it's because they use namespaces, and WP2Static is only counting the default namespace.

@john-shaffer
Copy link
Contributor

Setting true on https://github.com/leonstafford/wp2static/blob/c6b47808a58412f5865a595072380b451316d186/src/ViewRenderer.php#L317 fixes this. The functionality is already there, it just has to be turned on.

Since the default behavior is broken with namespaces, I'd be fine with removing it and making "by namespace" the only behavior. Thoughts?

@petewilcock
Copy link

@john-shaffer Keen to see a fix here, mostly because I'm seeing failures with the S3 addon that emit nothing in logs (even PHP logs) and the lack of a deploy cache is making it v. hard to track down.

@john-shaffer
Copy link
Contributor

@petewilcock Just change false to true in the line that I marked above.

@leonstafford
Copy link
Contributor

I've just defaulted it to true.

@john-shaffer what are the implications of removing all the non-combined namespace deploy cache code?

@john-shaffer
Copy link
Contributor

john-shaffer commented Feb 27, 2021

I think removal would be ideal. I think the two branches are only there because the old way was preserved when namespaces were added, but if someone ever does need the old system then they can just use 'default' namespace.

@leonstafford
Copy link
Contributor

Cool, I'll do the cleanup.

@leonstafford
Copy link
Contributor

@john-shaffer could you please give b6f0424 a test with a cpl of namespaced deploys?

I flipped the method names in DeployCache and made minor adjustments to views/CLI. Left the method to get totals just for one namespace, as that should give flexibility in scripting.

leonstafford added a commit that referenced this issue Feb 27, 2021
@petewilcock
Copy link

Adding a comment here to avoid issue bloat as it might be related to the changes here- @leonstafford in your latest 7.1.7 dev, I've noticed the Caches page is taking a reaaaaaally long time to load in some instances. After deploying a site with ~6500 URLs with a ~500mb cache for the crawled and post-processed site, the cache page takes a solid 3-4 minutes to load. After clearing the cache it loads fairly promptly. Maybe a super-expensive aggregation is occurring somewhere that gets worse the larger the cache is? Not sure - beefed up the container I'm running in to check but seems not to make a difference.

@leonstafford
Copy link
Contributor

Thanks @petewilcock, sorry for slow reply, been on the road this last week. Moved that into it's own issue, so I don't lose it. How quickly I can get to it is another matter :P

@john-shaffer
Copy link
Contributor

Fixed in 7.1.7

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

No branches or pull requests

4 participants