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

Asset compression #1923

Merged
merged 2 commits into from
Jan 12, 2018
Merged

Asset compression #1923

merged 2 commits into from
Jan 12, 2018

Conversation

bear454
Copy link
Contributor

@bear454 bear454 commented Jan 3, 2018

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the upstream master branch.
  • The tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works(if appropriate).
  • I have added necessary documentation (if appropriate).

Short description of what this resolves/which issues does this fix?:

  • Improves page load time by reducing asset download size.
  • Make necessary config changes to cope with asset compression.

Changes proposed in this pull request:

  • Perform compression of assets, both through minification/uglification & gzip compression in Rack.

@@ -60,6 +60,13 @@ class Application < Rails::Application
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'

# Set cache headers
config.static_cache_control = "public, max-age=31536000"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://edgeguides.rubyonrails.org/5_0_release_notes.html#railties-deprecations

Shall we re-write as following?
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' }


# Errors raised within `after_rollback`/`after_commit` propagate normally
# like in other Active Record callbacks.
config.active_record.raise_in_transactional_callbacks = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deprecated in Rails 5. I had removed this line in #1130, so I'm guessing it was re-added because of a conflict during a rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's applicable to Rails 4.2. In Rails 5.0 those exceptions are not suppressed and that line only shows a depreciation warning rails/rails@07d3d40

@bear454
Copy link
Contributor Author

bear454 commented Jan 12, 2018

@AEtherC0r3 ... are we good?

@bear454 bear454 merged commit 32a6d69 into openSUSE:master Jan 12, 2018
@bear454 bear454 deleted the asset-compression branch January 12, 2018 16:06
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.

3 participants