-
Notifications
You must be signed in to change notification settings - Fork 671
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
Suggestion: Recognise Rev'd Files in Same Directory #1246
Comments
@dgotilla I can't think of any reason for not doing this. Do you want to do a PR? |
@dgotilla I've investigated a bit more and I think our regexp are accurate. We are matching the full url and we use the initial This is the HTML we are using in one of the tests: And this is the URL we are trying to match: You can see that it's the full URL and not just Do you have a website where you are experiencing your problem? Mind sharing it with us? I'll close this issue until we have more information. Thanks! |
You are correct; I misdiagnosed the problem: whether the file is in the same directory or not has no relation to the link being flagged as an HTTP-Cache Error because "No configured patterns for cache busting match…". Perhaps this is being caused by the file extension ("webmanifest") or the Content-Type ("application/manifest+json"). I believe that whatever the cause, it may also be related to HTTP Compression Errors being generated by the same link. You can see an example of both errors being generated (incorrectly, AFAIK) in this report: https://webhint.io/scanner/a67087e6-1307-4951-9782-e9e89be46f8b |
This is interesting. If I run your website locally I don't get any error for the manifest url. Thanks! |
The current regular expression used for recognizing file revving does not allow for files saved in the same directory as the web page. So the following LINK tag is flagged as an HTTP-Cache Error because "No configured patterns for cache busting match…":
<link rel="manifest" href="manifest-1f76050c12.webmanifest">
However, the following tags would not be flagged:
<link rel="manifest" href="/manifest-1f76050c12.webmanifest">
<link rel="manifest" href="/dir/manifest-1f76050c12.webmanifest">
My suggestion is to remove the initial
\/
from each of the 4 sub-patterns yielding:/[^/]+[._-]v?\d+(\.\d+(\.\d+)?)?[^/]*\.\w+$/i
/v?\d+\.\d+\.\d+.*?\//i
/v\d.*?\//i
/([^/]+[._-])?([0-9a-f]{5,})([._-].*?)?\.\w+$/i
The text was updated successfully, but these errors were encountered: