You can backup the entire Mozilla profile, from cache to extensions, passwords, settings, etc. You can do this by using MozBackup, an application which does exactly what you want. Of course, newer Mozilla products have SYNC feature available which you can use to save everything that is stored by your browser but the cache could be a problem if it's too big so in this case the application is better to be used.
Simply download the program, install it using the installer package and then start a new Backup operation and select everything you want to back up. Next time when you install a Mozilla product, use this application, browse to where you saved your backup and click Restore and that's it. Upon restarting the browser, all your settings, extensions,passwords, cache will be restored.