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

Add Enable cache file for sing-box #5026

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

GibMeMyPacket
Copy link
Contributor

This PR adds the Enable cache file for sing-box in the options.
If enabled, you will have the below json in the sing-box config:

  "experimental": {
    "cache_file": {
      "enabled": true
    }
  }

This helps a lot by decreasing the start failures of sing-box when it's unable to download the .srs files (by caching and using the cached .srs files).

@2dust
Copy link
Owner

2dust commented Apr 26, 2024

No need to add parameters to control this function
Just hardcode it to enable
This feature is now implemented

singboxConfig.experimental = new Experimental4Sbox()
{
    cache_file = new CacheFile4Sbox()
    {
        enabled = true
    },
    //v2ray_api = new V2ray_Api4Sbox()
    //{
    //    listen = $"{Global.Loopback}:{Global.StatePort}",
    //    stats = new Stats4Sbox()
    //    {
    //        enabled = true,
    //    }
    //},
    clash_api = new Clash_Api4Sbox()
    {
        external_controller = $"{Global.Loopback}:{LazyConfig.Instance.StatePort}",
    }
};

@GibMeMyPacket
Copy link
Contributor Author

No need to add parameters to control this function Just hardcode it to enable This feature is now implemented

singboxConfig.experimental = new Experimental4Sbox()
{
    cache_file = new CacheFile4Sbox()
    {
        enabled = true
    },
    //v2ray_api = new V2ray_Api4Sbox()
    //{
    //    listen = $"{Global.Loopback}:{Global.StatePort}",
    //    stats = new Stats4Sbox()
    //    {
    //        enabled = true,
    //    }
    //},
    clash_api = new Clash_Api4Sbox()
    {
        external_controller = $"{Global.Loopback}:{LazyConfig.Instance.StatePort}",
    }
};

@2dust
I already seen that part of code.

  • I may want to have statistics without the cache.
  • I may want to have the cache without statistics.
  • As an end-user, no one knows that they will get cache with enabling statistics.
  • statistics are placed in Options > V2rayN, while the cache is a Core option

@2dust 2dust merged commit 855fd4f into 2dust:master Apr 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants