evangipson / midio

midio will work really hard to generate you endlessly interesting audio on the fly.
http://evangipson.com/midio
GNU Affero General Public License v3.0
21 stars 0 forks source link

Users shouldn't need a cache refresh to get updated JS/CSS #28

Closed evangipson closed 6 years ago

evangipson commented 6 years ago

Expected Behavior

When a user comes to midio, they should always be served the freshest copy of "production ready" (or on master) javascript & css.

Actual Behavior

Users get cached JS or CSS sometimes, because I'm not setting any caching stuff on my end as far as I know. This would be through bluehost. Apparently I can use an .htaccess file... but I feel like that will be a lot of work.

Steps to Reproduce the Problem

  1. Load up midio
  2. Leave your session open for 2 days
  3. Load up midio again without a cache refresh
  4. Notice the old JS and CSS

Specifications

evangipson commented 6 years ago

I fixed this outside of the repo on my server by modifying my .htaccess file with this line:

# 12 hours for static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico|html|svg|php)$">
Header set Cache-Control "max-age=43200, public"
</filesMatch>

I put this in my evangipson.com root, so it also applies to all the other projects in that subdomain, including midio.

Verified working here: image