-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Glide-Tag doesn't base64 encode filenames #2814
Comments
This is what the Glide library does. But since the URL includes the full original filename the negative SEO impacts are none to minimal. |
However personally I’d rather have Glide not do this. Just append the preset name or whatever to the original filename. |
For me the filename is not included, it is replaced with a base64 encoded string of the filename. Just to clarify it is statamic that does this and not glide: cms/src/Imaging/GlideUrlBuilder.php Lines 38 to 52 in 13b70fa
If there is any way to get the original filename i would be happy to know. There are 3 potential factors for SEO performance of a image (title, filename/path, alt), eliminiating one of the factors is not what I would call minimal. |
I was mistaken who sets the filename. But the full path/url does include the original filename for me. Something like this: https://site.nl/img/containers/assets/general/filename.png/b453f147a414847b1746aba987251fd6.webp That doesn’t happen for you? So that way to me you can still have the correct title, alt and filename/path. Google is smart enough to figure out the relevant keywords from a url like above. As I said I agree it would be nicer if it just didn’t do this. |
No for me it looks like:
|
That's not good. I suspect you can work around this by serving cached images directly. Can you try this? https://statamic.dev/tags/glide#serving-cached-images-directly |
If the cache is enabled I get the same behavior as @robdekort . That is way better, thank you. Still hope it gets changed in the future, but with the cache enabled it kinda works for now. |
Glad to hear! It'll make your site faster this way so that's a plus! |
This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me. |
I think this is still valid although it's more a FR. Maybe it should be moved there for now? Base encoding the filename regularly causes questions on Discord and I don't think it really serves a purpose. When using glide presets the SEO penalties are minimal, but when using Glide on the fly this definitely hurts. A beter alternative I think would be to slugify the original filename and prepend/append the glide preset name or width + height. |
Ran into this client request today. I know it's not 100% intuitive, but what about a config option where we have: (filename)+(hash).(extension) e.g. I can whip together this PR if someone might find this useful. It would be an "opt-in" to include the filename. My only other thoughts are file name limitations for really long names - given why they are limited to 64 here - we could provide a warning on that. |
So Statamic is responsible for base64 encoding filenames and not glide. It seems this approach is taken to avoid filename length limitations? Perhaps there is a better way beacause this approach produces some awful looking / SEO-unfriendly urls. Limiting / truncating the filename length on upload seems like a better approach. Here's one example of a non-cached manipulation, I'm sure I could find longer ones: In the Glide documentation you could simply use the original filename: It would be great if there was an overall improvement to Glide filenames, for both non-cached (above) and cached (ahinkle's answer) manipulations. I have SEO obsessed clients who spend a lot of time renaming assets and I haven't told them that Statamic doesn't actually use the filename. |
I am not particularly invested into this issue but here is a maybe clever way to workaround this issue. Basically you would utilize
Most modern browsers will very rarely, if ever, request the original However I would advise against this and use |
I had completely forgotten about this, but since this issue was reported, Peak changed it's strategy regarding images:
While this strategy is working out great, filenames are not. We've been talking about this in the Peak Discord and would love a solution where the original filename is preserved. |
What @robdekort said in the last comment. I also ran into the problem. SEO-friendly image URLs would as well be important for me. A current client website is virtually unusable with |
Bug Description
The glide tag currently base64 encodes the filename. I don't really know why it does it, but it is pretty bad from a user and seo perspective. We need an option to turn this behavior off and have the normal filename in the url.
Extra Detail
Google Image best practices: https://support.google.com/webmasters/answer/114016?hl=en
Environment
**Statamic version:3.0.20 Pro
**PHP version:7.4.10
Install method (choose one):
statamic/statamic
The text was updated successfully, but these errors were encountered: