mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
The default behavior for Rails is to vary the response of an endpoint based on the `Accept:` header, and therefore it returns a `Vary:` header on responses. This instructs browsers and intermediate proxies to key their caches based on the value of the request's `Accept` header. In some cases (e.g. Akamai), the presence of a `Vary` header is enough to prevent caching entirely. This commit restructures the Rails route definitions so that: 1. The "format" segment of the route is 'required' 2. The "format" segment of the route is constrained to a single value (e.g. `js` or `css`) Now that the routes are guaranteed to have a `:format` segment, Rails will always prioritize that over the `Accept` header, and will therefore omit the `Vary` header. Request specs are also added to test this behaviour for both stylesheets and theme-javascripts. |
||
---|---|---|
.. | ||
cloud/cloud66 | ||
environments | ||
initializers | ||
locales | ||
application.rb | ||
boot.rb | ||
cdn.yml.sample | ||
database.yml | ||
deploy.rb.sample | ||
dev_defaults.yml | ||
discourse_defaults.conf | ||
discourse.config.sample | ||
discourse.pill.sample | ||
environment.rb | ||
logrotate.conf | ||
multisite.yml.production-sample | ||
nginx.global.conf | ||
nginx.sample.conf | ||
projections.json | ||
puma.rb | ||
routes.rb | ||
sidekiq.yml | ||
site_settings.yml | ||
spring.rb | ||
thin.yml.sample | ||
unicorn_launcher | ||
unicorn_upstart.conf | ||
unicorn.conf.rb |