Cashner was born and raised in Conroe, Texas. His father, Jeff, runs a family mortuary business while his mother, Jane, is a seamstress. The second of three children, he grew up on a 15-acre (6.1 ha) ranch where he became expert at horseback riding and calf roping, and was involved in the local 4-H and Future Farmers of America youth organizations. He began playing baseball during his childhood, practicing with his brother and mother on a regulation-size baseball diamond which his parents constructed on their property.
He graduated Conroe High School in 2005 and was drafted by the Atlanta Braves, but decided to attend college instead. He attended Angelina College and Texas Christian University. He was drafted in college by the Colorado Rockies and Chicago Cubs, but only accepted the latter team's second offer when they made him a first-round draft pick.
Cashner was drafted by the Chicago Cubs in the first round, 19th overall, in the 2008 Major League Baseball Draft out of Texas Christian University. He was rated the Cubs fourth best prospect prior to the 2010 season by Baseball America. Throughout three minor league seasons in the Cubs organization Cashner only gave up three home runs.
Cashner was called up to the majors for the first time on May 31, 2010. He made his major league debut that day. In the 2010 season, Cashner appeared in 53 games as a relief pitcher.
On March 26, 2011, Cashner was named the Cubs' 5th starter. However, Cashner only made one start for the team before being forced out with a rotator cuff injury. After a rehab stint in the minors, Cashner returned to the Cubs in September in the role of relief pitcher.
On January 6, 2012, the San Diego Padres acquired Cashner and outfielder Kyung-Min Na from the Cubs for first baseman Anthony Rizzo and right-handed starting pitcher Zach Cates. Cashner began the season as a relief pitcher, appearing in 27 games in relief and compiling a 3.81 ERA and 29 strikeouts.
On June 9, 2012, he made a short start against the Milwaukee Brewers before being sent down to increase his arm's endurance in preparation for a starting role. He returned to the majors on June 28 to join the starting rotation after making 3 starts with the AA San Antonio Missions. In his second full-fledged start with the Padres, he strained his right latissimus dorsi muscle while warming up for the third inning and was placed on the disabled list. Cashner returned to the starting line-up September 7, but was shut down again after two starts with an injured tendon. Cashner's fastball was down by 5-8 mph after his return from the disabled list. Cashner finished the season with a 3-4 record and 4.27 ERA with 52 strike-outs in 46 1⁄3 innings.
In the off-season, Cashner cut the thumb on his pitching hand in a hunting accident. The injury delayed Cashner's preparation for 2013, but by the end of April he was part of the Padres' starting rotation after beginning the season in the bullpen.
On July 27, 2013, Cashner hit his first career home run off of Arizona Diamondbacks pitcher Josh Collmenter. On September 16, Cashner pitched a one-hit complete game shutout against the Pittsburgh Pirates in which he faced the minimum 27 batters. The Pirates' lone hit was a single to right field by Jose Tabata leading off the seventh inning. Tabata was forced out when Andrew McCutchen hit into a double play to end the inning. Cashner threw 97 pitches, struck out 7 and did not walk a batter. The Padres won the game 2-0. Cashner got better as the season progressed, posting a 2.14 ERA in 11 starts in the second half while raising his strike-out rate.
Cashner finished the 2013 season with a 10-9 record and a 3.09 ERA with 128 strikeouts in 175 innings pitched; the Padres imposed an innings limit on him that season. He was the unanimous winner of the Clyde McCullough Pitcher of the Year Award, awarded to the Padres top pitcher by the San Diego chapter of the Baseball Writers' Association of America.
In 2014, Cashner struggled with injuries and a lack of run support. He missed about 3 months of the season with elbow, shoulder and neck injuries and was winless for 11 straight starts despite a 2.86 ERA in that stretch. Cashner pitched his second career one-hit shutout on April 11, 2014, against the Detroit Tigers. He threw 108 pitches and struck out a then career-high 11 batters as the Padres won 6–0. This game came only 4 regular season starts after Cashner's first one-hitter. On April 24, 2014, Cashner played left field for 1 at bat after Seth Smith suffered an injury in an extra inning game versus the Washington Nationals. The Padres would go on to win the game 4-3 in 12 innings.
On July 29, 2016, the Padres traded Cashner, Colin Rea, and Tayron Guerrero to the Miami Marlins for Jarred Cosart, Carter Capps, Josh Naylor, and Luis Castillo. In his first start as a Marlin, Cashner pitched six innings, surrendering two runs while striking out two in a no decision against the Cardinals on July 31.
Cashner signed a one-year, $10 million contract with the Texas Rangers on November 21, 2016.
Cashner relies mainly on a four-seam fastball that can surpass 100 mph. The fastball averaged 99.4 mph in the first half of 2012 when he was working as a reliever and 94.8 mph in 2013 when he was primarily a starter. His secondary pitches are a change-up and slider, with an occasional sinker. According to Fangraphs, Cashner's fastball in 2013 was the fifth fastest among major-league starters. Padres catcher René Rivera said Cashner that season "learned how to be a pitcher" who can "get outs quick", as opposed to being a mere thrower.
Cashner, his brother, and sister established the Cashner Family Foundation, "Pitching for a Cause", which provides funding to hospitals and communities on behalf of children with medical issues. The foundation grew out of their experience watching their mother survive breast cancer in 2004 and then lose a leg after suffering septic shock in 2015.