A lot of these files can be removed completely from Magento while some can be trimmed down, so let's go through each one and see what we can do.
This is the core Prototype library file and is required by Magento. You cannot remove this without breaking pretty much your entire Magento frontend. That being said, you should definitely minifying it.
This handles the client side form validation in Magento. When a user clicks the 'Submit' button, Magento uses the class names for each input field in the form to work out what each input value should be. If the validation fails, the form does not submit and the relevant error message is displayed.
This file cannot be removed entirely as all of your Magento forms rely on this file. That being said, I'm a stickler for efficiency and believe that every byte saved is a good thing. As I only use PayPal on my site, I have no need for credit card validation. As a result, I was able to remove a great deal of code from this file that validates credit card data. This task might not be for you though and if you do decide to do it, you will have to re-do the changes each time you update Magento.
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>scriptaculous/builder.js</file> </action> </reference> </default>
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>scriptaculous/effects.js</file> </action> </reference> </default>
This file allows dragging and dropping of elements. Unless you're using the default Magento image zoom (lol, I know) then this can be removed using the following XML code:
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>scriptaculous/dragdrop.js</file> </action> </reference> </default>
This file provides AJAX based functionality such as search autocomplete and in place editing. Most themes don't use it so this file can also be removed.
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>scriptaculous/controls.js</file> </action> </reference> </default>
This JS file powers the Magento category/top menu and allows for the hover/dropdown effects. Unless you are using the default menu system, this can be removed using the following XMl code:
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>varien/menu.js</file> </action> </reference> </default>
<default> <reference name="head"> <action method="removeItem"> <type>js</type> <file>mage/translate.js</file> </action> </reference> </default>
You will also need to modify your template/page/html/head.phtml file and remove the following line of PHP code:
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<default> <remove name="js_cookies" /> <remove name="global_cookie_notice" /> <reference name="head"> <action method="removeItem"> <type>js</type> <file>mage/cookies.js</file> </action> </reference> </default> <catalog_product_view> <remove name="external.pagecache.cookie" /> </catalog_product_view>
With this, you also need to remove the default Magento files that reference the Mage.Cookies JS object.