Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent caching dev versions of static files #409

Closed
luboskmetko opened this issue Jan 8, 2019 · 3 comments · Fixed by #421
Closed

Prevent caching dev versions of static files #409

luboskmetko opened this issue Jan 8, 2019 · 3 comments · Fixed by #421
Labels

Comments

@luboskmetko
Copy link
Member

Because of the expire settings in .htaccess dev version of static files like main.css, app.bundle.js are cached for long time. This can result in cached files being used by browser instead of the updated files which can be quite confusing.

@jakub300 @JakubSzajna any ideas how to solve this while keeping expires settings for the build version?

@luboskmetko luboskmetko added the bug label Jan 8, 2019
@luboskmetko
Copy link
Member Author

Per @marcinkrzeminski suggestion the following update to revisionPath function should solve this:

...
return sprintf(
  '%s/%s%s%s',
  get_template_directory_uri(),
  \Chisel\Settings::DIST_PATH,
  trim( $asset, '/' ),
  '?' . time()
);
...

If that's ok, I would submit PR.

@jakub300
Copy link
Collaborator

jakub300 commented Jan 8, 2019 via email

@luboskmetko
Copy link
Member Author

@jakub300 seems to work ok with browsersync. Also it would be only used in dev mode so only here. Revisioning of production files would work like now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants