composer: Composer doesn't cache Toran Proxy JSON files

When packagist: false is enabled and I proxy all public packages through my Toran Proxy instance Composer doesn’t make use of cached JSON files that it downloaded previously (even if I ran composer up just a few seconds before).

Removing the proxying and re-enabling Packagist results in Composer using the locally cached JSON files.

Is this expected behaviour?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

Toran 1.3.0 released just now fixes this (and some other issues/features). Sorry for taking so long to get to this, but hopefully it’ll be worth it.

Note that Composer will still download the files (due to what I explained in https://github.com/composer/composer/issues/3799#issuecomment-76410381) but they are now static files on disk and not hitting php every time so it is returned by the web server a lot faster, and Composer will also fetch the files it has in cache sending an If-Modified-Since header so if your webserver is configured correctly it’ll just return a Not Modified response and in cases where the cache is up to date.

Full changelog of 1.3 + 1.2 which were both released this week:

  • Added a list of other public repos to mirror on top of packagist, which lets you sync wpackagist, magento repos, etc.
  • Added detailed listing pages for private packages
  • Added support for the new style of BitBucket hooks
  • Added an easy way to update single private packages from the UI
  • Added support for updating single packages from CLI, via bin/cron <packagename>
  • Added a JSON API to create private packages, see Documentation > FAQ > How to create private packages programmatically?
  • Updated dependencies for PHP7 support and latest Composer features
  • Fixed packagist proxy to cache provider files in web dir, which makes it a lot faster to run updates
  • Fixed bug with the automatic update of packages after they are added
  • Fixed a few minor bugs

You can run “php app/console toran:update” to update. If you hit any regression please let me know by email at toran@nelm.io and I’ll try to push out a fix ASAP.