Best Practice to manage all asset caching (images, css, js, everything)

后端 未结 1 719
無奈伤痛
無奈伤痛 2021-02-07 18:15

I\'m working on a moderately-sized web application and trying to come up with the best solution to make all browsers use the cache and only invalidate it when there is an update

1条回答
  •  悲哀的现实
    2021-02-07 18:36

    Found what I believe to be an acceptable solution at How to force browser to reload cached CSS/JS files? No idea how I missed this in my original investigation.

    For anyone who comes to this question, note I'm referring to the first answer on the linked page that references Google's mod_pagespeed plugin for apache. This works at the web server level, thus "[it works] with PHP, rails, python, static HTML -- anything."

    This is precisely the kind of solution I was looking for. This tool, or something similar, should be in use by all web developers to keep caching logic orthogonal to the code itself.

    0 讨论(0)
提交回复
热议问题