Torniojaws / vortech-front

React frontend for the Vortech website
https://vortechmusic.com
MIT License
0 stars 0 forks source link

Add cache control and accept encoding #51

Open Torniojaws opened 6 years ago

Torniojaws commented 6 years ago

https://tools.pingdom.com/#!/dXERHP/https://vortechmusic.com

The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
https://vortechmusic.com/926469a8a20ed1cc0a5db236b281eb72.jpg
https://vortechmusic.com/api/1.0/visits/
https://vortechmusic.com/bundle.js
https://vortechmusic.com/static/img/external/bandcamp.jpg
https://vortechmusic.com/static/img/external/facebook.jpg
https://vortechmusic.com/static/img/external/lastfm.jpg
https://vortechmusic.com/static/img/external/soundcloud.jpg
https://vortechmusic.com/static/img/external/twitter.jpg
https://vortechmusic.com/static/img/external/youtube.jpg
https://vortechmusic.com/static/img/logo.png
https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit

https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

And

The following publicly cacheable, compressible resources should have a "Vary: Accept-Encoding" header:
https://vortechmusic.com/
https://vortechmusic.com/api/1.0/visits/
https://vortechmusic.com/bundle.js

https://developers.google.com/speed/docs/insights/rules

FAILED - (No max-age or expires) - https://vortechmusic.com/bundle.js
FAILED - (No max-age or expires) - https://vortechmusic.com/api/1.0/visits/
FAILED - (No max-age or expires) - https://vortechmusic.com/static/img/logo.png
FAILED - (No max-age or expires) - https://vortechmusic.com/api/1.0/news/
FAILED - (No max-age or expires) - https://vortechmusic.com/926469a8a20ed1cc0a5db236b281eb72.jpg
FAILED - (No max-age or expires) - https://vortechmusic.com/1752a95b114dae4ca722c22020cfdea2.woff
FAILED - (5.0 minutes) - https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit
FAILED - (12.5 minutes) - https://static.doubleclick.net/instream/ad_status.js
Torniojaws commented 6 years ago

Easier to do in the Backend flask config:

app = Flask(__name__)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 300

https://stackoverflow.com/a/37331139/1488445