Welcome Guest, Not a member yet? Register   Sign In
Cache js or css files
#11

Use Grunt or Gulp to minify your assets as a build step in production/testing. Have the task update a config variable in your config.php to set a version number. Output paths using the version number as a segment and set a very long cache expiration (20 years). Use an htaccess rule to remove the version number from the path and direct it to the actual file.
Reply


Messages In This Thread
Cache js or css files - by ufhy - 08-17-2016, 07:18 PM
RE: Cache js or css files - by mario - 08-17-2016, 10:23 PM
RE: Cache js or css files - by mario - 08-17-2016, 10:39 PM
RE: Cache js or css files - by Diederik - 08-17-2016, 11:46 PM
RE: Cache js or css files - by ufhy - 08-19-2016, 06:35 AM
RE: Cache js or css files - by svennd - 08-21-2016, 02:01 AM
RE: Cache js or css files - by PaulD - 08-21-2016, 05:52 PM
RE: Cache js or css files - by ufhy - 08-22-2016, 11:32 AM
RE: Cache js or css files - by spjonez - 08-26-2016, 06:08 AM
RE: Cache js or css files - by mwhitney - 09-16-2016, 02:02 PM
RE: Cache js or css files - by spjonez - 09-16-2016, 02:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB