cve-search/vulnerability-lookup

Performance improvement - htmx

stalpers opened this issue · 1 comments

Thank you for implementing the custom RSS feeds.

I have another idea which might improve the speed of the vulnerability results while reducing the size of the results page. To include all necessary information, you have added a drop down to view the JSON drop down which is implemented by rendering all JSON in the returned HTML.
Instead, it would be more performant to load only the data the user is interested in. Although traditionally APIs would be used an easier and more intuitive solution is available htmx

Unfortunately, I am really bad at Flask and cannot directly create a Pull request, but you could create a new template vuln_detail.html which does the same als line 38-393 in vulnerabilities.html the view for vuln_detail.html should accept the vuln-id as a parameter & display the details - without the master template.

The JSON could be loaded like this (untested) - see also here https://htmx.org/examples/lazy-load/

<a role="button" hx-get="/vuln_details?{{vulnerability_id}}" hx-trigger="load" hx-target="#collapse_div" class="btn btn-primary" data-bs-toggle="collapse" data-bs-target="#collapseJson{{vulnerability_id}}" aria-expanded="false" aria-controls="collapseJson{{vulnerability_id}}">

htmx is also great when it comes to searching https://htmx.org/examples/active-search/ or CRUD operations

Thank you for the information, I'll have a loot at this. Actually one of the next development is to improve the vuln view. The goal is to display more relevant information for each sources of vulnerabilities, with the same level of detail when possible.
For the moment the view is very light.