This is a great suggestion. If filesize cannot be figured out, then a way to save only the last 10,20,30,60 seconds might be a way around it?
Until then you can easily post-process your gif to trim it down to size: Post-processing Animated GIFs I used this approach for the Daily Driver trailer.