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

Add static content for media pages #557

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

KyleMaas
Copy link
Contributor

Description

Media pages are essentially unsearchable right now because all of the relevant information is contained within JavaScript. This change adds some of the metadata for media as static textual content on the page so it can be properly indexed.

Steps

Pre-deploy

Post-deploy

@KyleMaas
Copy link
Contributor Author

Made a few additional changes to include subtitle content as searchable text as well and to hide the metadata during page load.

@KyleMaas
Copy link
Contributor Author

I should note that the changes that I made to hide metadata during page load require a frontend rebuild, but I wasn't sure how best to go about submitting that. Committing the built files seems like a great way to cause conflicts, so I did not do that.

@mgogoulos
Copy link
Contributor

Thanks for this work! I see the point but I'm very skeptical for a number of reasons.

This is adding lots of extra queries for the index/media pages, and that could impact a heavy portal.
These queries could be optimized to get only the necessary information (eg use Django tools as the 'only' on a queryset to get the list of items -title/description- and not the whole objects.

However isn't there redundancy in making these queries twice (one to get the metadata, and one to get it through the API).

Keep in mind that if the template takes time to load (because it's making these queries), then the page won't show up anything (because the template has to load, and then the frontend is making the API queries).

If media data are returned to the Django template, then what is the reason to call the API - all data could be returned to the template, and this would give more consistent results.

What do you think?

@KyleMaas
Copy link
Contributor Author

Potentially, yes, but that seemed like a much deeper architectural change than I'd want to do without discussion. This solution, while it increases the initial page load time slightly, significantly improved searchability. Having the metadata embedded into the page as JSON and eliminating the API call would be a great way to have both the searchability, better compatibility with non-JS browsers and screen readers, and eliminate the duplication.

Thank you for your feedback on this.

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.

None yet

2 participants