-
Notifications
You must be signed in to change notification settings - Fork 107
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
HTTP Caching - metadata endpoint #207
Comments
The problem with the size of these files is quite big. We've noticed it before, but at the moment I don't know what a good solution is (this applies to more packages from Yes, there is no http cache on the metadata endpoint at the moment (for private packages it will not be present). Nevertheless, it's hard for me to believe in this time comparison, because the composer caches this metadata, so in the case of normally As for the metadata cache ( |
Doing a basic Laravel install using both packagist and repo.repman.io: Packagist{
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
}
}
repo.repman.io{
"repositories": [
{"type": "composer", "url": "https://repo.repman.io"},
{"packagist": false}
],
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
}
}
The example from my initial comment had more packages in it, as well as some internal ones. |
I noticed using your docker install that this endpoint often ran out of memory writing the JSON file locally. Can you increase the memory limit for PHP-FPM? (--I couldn't find a Dockerfile for the image-- (I'm an idiot, and have now found it))
The files are already being written to the disk, so there just needs to be an HTTP cache check when serving them. A Cron that checks the ETag with packagist.org regularly should keep that cron time down. |
Hey @giggsey, so:
I intentionally do not want to do a mechanism that will update these files from time to time. Once that it's unnecessary. Two that I saw the composer developers' request not to do such mirrors in such a way that they ask every second (or other period) for all packages. |
Sounds good. I know repman mirrors the packages, but will it use the local copy of the provider JSON if it can't reach packagist to check if the page is stale? |
Good question, not at the moment. Only downloaded distribution files work like this. But since you mentioned it, I'll take this feature straight away. If it is not possible to download the fresh metadata file, the old one will be returned. |
Hey @giggsey we just deployed changes with http cache. You can check if performance is better now 😉 |
I'm getting a 304 when hitting https://repo.repman.io/p/symfony/http-foundation, but the body is still being transmitted. This means the response time for me is ~5s still. TFFB is around 260ms, which is fine. Testing it using my local (via a VPN) repman instance is taking around 1000 seconds for a Laravel project. |
* Only add the Response stream if the Request is a cache miss Fixes #207 * Cache downloads / package list Response::isNotModified() doesn't need to be wrapped in the if statement, as it'll remove the content (even for a StreamedResponse)
* Only add the Response stream if the Request is a cache miss Fixes #207 * Cache downloads / package list Response::isNotModified() doesn't need to be wrapped in the if statement, as it'll remove the content (even for a StreamedResponse) * Package List Search Signed-off-by: Joshua Gigg <[email protected]> * Package List Search * CS * Use ILIKE instead * Separate filter SQL so it's not always required * Add tests & fix searching * Fix PHPStan * CS
I've tried a Laravel project (with a few internal packages) going through a self-hosted install, then the hosted version.
Both repman installs are taking around 30 minutes to run with composer v1. This compares to 25 seconds when using packagist directly.
I believe the reason for this is that there are no cache headers on any of the repman responses.
This one file itself is 25MB, and my Laravel install ends up downloading 500MB every time I try a composer update.
The text was updated successfully, but these errors were encountered: