chore: Improve widget loading performance (#1191)

* Frontend assets url

* Remove font files from widget

* Rename variable to ASSET_CDN_HOST
This commit is contained in:
Pranav Raj S
2020-09-03 13:17:45 +05:30
committed by GitHub
parent 17968e6d3f
commit dfb533db8d
4 changed files with 14 additions and 4 deletions

View File

@@ -4,6 +4,9 @@ SECRET_KEY_BASE=replace_with_lengthy_secure_hex
# Replace with the URL you are planning to use for your app
FRONTEND_URL=http://0.0.0.0:3000
# If you plan to use CDN for your assets, set Asset CDN Host
ASSET_CDN_HOST=
# Force all access to the app over SSL, default is set to false
FORCE_SSL=false
@@ -103,7 +106,7 @@ IOS_APP_ID=6C953F3RX2.com.chatwoot.app
# VAPID_PUBLIC_KEY=
# VAPID_PRIVATE_KEY=
#
# for mobile apps
# for mobile apps
# FCM_SERVER_KEY=
## Bot Customizations

View File

@@ -0,0 +1,8 @@
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('~shared/assets/fonts/Inter-Regular.woff2?v=3.11') format('woff2'),
url('~shared/assets/fonts/Inter-Regular.woff?v=3.11') format('woff');
}

View File

@@ -3,7 +3,7 @@
@import 'buttons';
@import 'mixins';
@import 'forms';
@import 'shared/assets/fonts/inter';
@import 'shared/assets/fonts/widget_fonts';
@import '~ionicons/scss/ionicons';
@import '~spinkit/scss/spinners/7-three-bounce';

View File

@@ -31,8 +31,7 @@ Rails.application.configure do
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
config.action_controller.asset_host = ENV.fetch('ASSET_CDN_HOST') if ENV['ASSET_CDN_HOST'].present?
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX