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

Suggestion: Recognise Rev'd Files in Same Directory #1246

Closed
dgotilla opened this issue Aug 19, 2018 · 5 comments
Closed

Suggestion: Recognise Rev'd Files in Same Directory #1246

dgotilla opened this issue Aug 19, 2018 · 5 comments

Comments

@dgotilla
Copy link

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

@molant
Copy link
Member

molant commented Aug 20, 2018

@dgotilla I can't think of any reason for not doing this. Do you want to do a PR?

@molant
Copy link
Member

molant commented Sep 5, 2018

@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 / to know where the path starts:

This is the HTML we are using in one of the tests:

image

And this is the URL we are trying to match:

image

You can see that it's the full URL and not just styles.css.

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!

@molant molant closed this as completed Sep 5, 2018
@dgotilla
Copy link
Author

@molant,

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

@molant
Copy link
Member

molant commented Sep 12, 2018

This is interesting. If I run your website locally I don't get any error for the manifest url.
I've opened #1307

Thanks!

@dgotilla
Copy link
Author

Thank you for your time, @molant. I'll follow #1307.

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

No branches or pull requests

2 participants