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

Switching to and from HTTP to HTTPS causes rebuilds #68

Open
tomjn opened this issue May 2, 2014 · 2 comments
Open

Switching to and from HTTP to HTTPS causes rebuilds #68

tomjn opened this issue May 2, 2014 · 2 comments

Comments

@tomjn
Copy link
Contributor

tomjn commented May 2, 2014

Excessive rebuilds can be triggered by mixing or swapping http and https URLs in LESS variables

E.g. visiting

http://example.com
https://example.com
http://example.com

Will trigger rebuilds despite no file or variable changes

@lkraav
Copy link

lkraav commented May 2, 2014

Yes, I also discovered that dynamics in the stylesheet will cause this side effect. I was building background header image logic into LESS mixins where less_vars filter was substituting the background image url and then discovered every page load caused a rebuild.

If you're just switching protocols, you should do protocol-relative // anyway. But if anything about the request URL changes, you will get a rebuild.

In my mind, if this can even be considered a bug, wp-less caching system should make filenames also hash-based.

@tomjn
Copy link
Contributor Author

tomjn commented May 2, 2014

#63 Now contains fixes for this. It changes the cache and css build files to contain the protocol in their filename. This means moving from one to the other will generate a worst case scenario of 2 builds, rather than indefinite rebuilding per page load. It also bypasses the issue of changing http to https and vice versa and which URLs to apply it to

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

No branches or pull requests

2 participants