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

SEO-Friendly Naming Scheme for Image Uploads with Corresponding Test Cases #1441

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Pushkraj19
Copy link

This pull request introduces a new SEO-friendly naming scheme for image uploads in the UploadsController to ensure that uploaded files have clean, descriptive, and URL-friendly filenames. The following changes have been made:

  • SEO-Friendly Naming Scheme:

    • When an image is uploaded, its filename is now generated using a combination of the original filename (converted to kebab-case) and a unique identifier derived from an md5 hash of the original name, ensuring a short and readable format.
  • Test Cases:

    • A test for empty upload validation (testEmptyUploadIsValidated), ensuring that empty file uploads are rejected with a 400 response.
    • A test for uploading an image (testUploadedImageCanBeStored), which verifies that images are uploaded correctly with the newly generated SEO-friendly filename.
    • A test for deleting an uploaded image (testDeleteUploadedImage), which verifies that images can be deleted after they have been uploaded, and the file no longer exists in storage.

Benefits:

  • Improved SEO: The filenames of uploaded images are now more descriptive and user-friendly, which helps improve SEO rankings.
  • Better file management: Using a unique identifier in the filename ensures that each uploaded file has a unique and predictable name.
  • Test Coverage: Added test cases validate both the upload functionality and deletion process, ensuring robust coverage of the new naming scheme.

This change enhances the SEO performance of image uploads while maintaining clean, understandable file naming and ensuring the upload and deletion processes work as expected.

@Pushkraj19
Copy link
Author

@austintoddj Please take a look at it and approve. Thank you.

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

Successfully merging this pull request may close these issues.

1 participant