By looking at the code I believe you implement (1), (2) but not (3)?
I just had a comment specifically about this third condition if we come to implement this in the future - I think it would be better to delete the oldest on a least recently used basis rather than based on insertion time (FIFO).