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

Can setup-php-sdk support cache #8

Closed
eeliu opened this issue Aug 1, 2024 · 1 comment
Closed

Can setup-php-sdk support cache #8

eeliu opened this issue Aug 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@eeliu
Copy link

eeliu commented Aug 1, 2024

Background

I found it takes lots of time in setup-php-sdk

image

Can we use cache to speed up this progress ? and how ?

@cmb69
Copy link
Member

cmb69 commented Aug 2, 2024

Can we use cache to speed up this progress ? and how ?

Good question! I also wonder for a long time how that can be done from within the action. Maybe have a look at https://github.com/actions/cache.

@cmb69 cmb69 added the enhancement New feature or request label Aug 2, 2024
cmb69 added a commit to cmb69/setup-php-sdk-php that referenced this issue Sep 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
For now we cache only the PHP SDK, the PHP binaries and the development
packs.  While this doesn't reduce network traffic much, it greatly
improves the setup performance (in case of cache hits, instead of a few
minutes, now less than half a minute).

Since clients may not want to use the cache, possibly because they are
already a lot of other files, and the cache size is likely limited, we
explicitly require clients to opt-in via the `cache` input parameter.
cmb69 added a commit to cmb69/setup-php-sdk-php that referenced this issue Sep 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
For now we cache only the PHP SDK, the PHP binaries and the development
packs.  This already greatly improves the setup performance (it might
easily safe a minute or two, in case of cache hits.  To be able to use
the current PHP revision as part of the cache key, we factor out
determine-revision.ps1.

Since clients may not want to use the cache, possibly because they have
already a lot of other files in their caches, we explicitly require
clients to opt-in via the `cache` input parameter.
cmb69 added a commit to cmb69/setup-php-sdk-php that referenced this issue Sep 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
For now we cache only the PHP SDK, the PHP binaries and the development
packs.  This already greatly improves the setup performance (it might
easily safe a minute or two, in case of cache hits).  To be able to use
the current PHP revision as part of the cache key, we factor out
determine-revision.ps1.  We create a separate cache for the PHP-SDK
since this likely rarely changes, and since the cached variant is
apparently much faster than fetching a GH release of the PHP-SDK.

Since clients may not want to use the cache, possibly because they have
already a lot of other files in their caches, we explicitly require
clients to opt-in via the `cache` input parameter.
@cmb69 cmb69 closed this as completed in d07cd98 Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants