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

Is the an option not to cache third-party files #85

Closed
jalateras opened this issue Jun 6, 2014 · 7 comments
Closed

Is the an option not to cache third-party files #85

jalateras opened this issue Jun 6, 2014 · 7 comments

Comments

@jalateras
Copy link

I'm looking at always serving third-party modules from https://registry.npmjs.org and only store and serve private modules from sinopia. Does such an option exist?

@rushes
Copy link

rushes commented Jun 6, 2014

yeah this would be very useful to us too

@rlidwka
Copy link
Owner

rlidwka commented Jun 26, 2014

How is it different from what it does now? Are you worrying about a disk space, or is it something else?

@jalateras
Copy link
Author

@rlidwka main issue for me would be around disk space.

@rlidwka
Copy link
Owner

rlidwka commented Jun 26, 2014

@jalateras , for now you can separate private modules from third-party ones, and move cache to /tmp/ for example (which you can remove at any time):

packages:
  'private-*':
    allow_access: user
    allow_publish: user
    storage: /tmp/

  '*':
    allow_access: all
    allow_publish: user
    proxy: npmjs
    storage: local_storage

I'll try to add support for not storing them at all, should be easy enough.

@jalateras
Copy link
Author

great. I'll give this a go.

rlidwka added a commit that referenced this issue Aug 8, 2014
@rlidwka
Copy link
Owner

rlidwka commented Aug 11, 2014

I added an option in sinopia@0.9.1, now you can specify storage: false in config file, and specified packages won't be stored to the disk.

But I'd suggest not to use it unless you have to, because it will consume a lot more traffic:

  • There will be no HTTP 304's for them, all data will be transmitted even if npm downloaded it previously. That's because normally ETags are stored to the hard disk.
  • For each tarball you request, sinopia will make two requests to the upstream (first to get package info, and second to get tarball itself). Normally it'll be just one request because package info is retrieved from hard disk.

But I suppose if you care about hard disk space more than about performance and bandwidth (embedded systems? mini-server like raspberry pi?) this would be useful.

@rlidwka rlidwka closed this as completed Aug 11, 2014
@jalateras
Copy link
Author

@rlidwka Great!! I'll upgrade to 0.9.1 and give it a go,

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

No branches or pull requests

3 participants