The translocation of polymers through nanopores with large internal cavities bounded by two narrow pores is studied via Langevin dynamics simulations. The total translocation time is found to be a nonmonotonic function of polymer length, reaching a minimum at intermediate length, with both shorter and longer polymers taking longer to translocate. The location of the minimum is shown to shift with the magnitude of the applied force, indicating that the pore can be dynamically tuned to favor different polymer lengths. A simple model balancing the effects of entropic trapping within the cavity against the driving force is shown to agree well with simulations. Beyond the nonmonotonicity, detailed analysis of translocation uncovers rich dynamics in which factors such as going to a high force regime and the emergence of a tail for long polymers dramatically change the behavior of the system. These results suggest that nanopores with internal cavities can be used for applications such as selective extraction of polymers by length and filtering of polymer solutions, extending the uses of nanopores within emerging nanofluidic technologies.