I included jquery and bootstrap mainly for user experience. When I checked my site’s speed on Google's PageSpeed, it recommended me to remove those libraries in order to boost page speed.
Now, if I remove those libraries permanently then I would be compromising the responsive feature of the website. So I decided to keep a server side check to confirm whether a bot or a browser is visiting my webpage. If a browser visits the webpage then I would include the libraries and if a bot visits my webpage I would not include the libraries.
Is it the right way? Will this affect SEO? Is there any other way I can achieve this?
I'm asking because if I do it this way then the bot’s rendering and browser’s rendering will be different (Though the text content and other contents still remains the same). Is it cloaking?
I found the Q&A "Does blocking content for some users and showing it to Google for indexing affect SEO" but this does not totally answer my situation.