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

Static file server #100

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Static file server #100

merged 3 commits into from
Aug 21, 2024

Conversation

rsamoilov
Copy link
Member

Static file server

Description

This adds the ability for Rage apps to serve static assets from the public folder.

Usage

Enable the feature using the public_file_server configuration:

  Rage.configure do
    config.public_file_server.enabled = true
  end

Features

  • Support Range requests;
  • Automatically serve gzip version of files if the client supports the gzip transfer-encoding;
  • Support If-None-Match and If-Range headers;

Benchmark

wrk http://localhost:3000/assets/40kb.js.gz

Rails: 8719 RPS
Rage: 22980 RPS

@rsamoilov
Copy link
Member Author

@nikki-dev-s This will go into the 1.9.0 release.

@rsamoilov rsamoilov merged commit 0f0f9d7 into master Aug 21, 2024
6 checks passed
@rsamoilov rsamoilov deleted the file-server branch August 21, 2024 16:50
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.

1 participant