Gritty Realism, as provided, in the DMG is fine
If you want to throw less combat encounters at your players, you can adjust the rest period according to what the DMG suggests, and you will be fine either way.
When modifying the durations for resting, so that you can deal with your issue of reducing the encounters per day, you have to understand the core purpose of rests in the context of D&D. Let's jump into it.
D&D is designed a game of attrition
As you said, the DMG expects you to throw 6-8 Medium to Hard encounters per adventuring day at the players. Much of the combat system of D&D is rest-based. Despite the emphasis on roleplaying in this edition, at its core, D&D is a game of attrition.
Your options are limited by design
When you desire to reduce the number of encounters per day, you are fundamentally going against this core feature of the design. That is why there are so little options for you to take here. This is like taking the D&D combat engine (the attack rolls, saving throws, ability checks, HP, spells, etc) and discarding it: the result is not something D&D was designed to handle. Keep this in mind when you fiddle around with encounters per adventuring day, because you are ultimately affecting the attrition aspect.
A game of attrition falsamente implies combat should be challenging
The fact D&D is designed this way keys DMs off that, somehow, subconsciously even, if there is no significant attrition in the game, it's not a challenge. If the players don't start an encounter at full resources, they aren't being pushed hard enough. It is easy to see why a lot of DMs think this is true. Having an "I Win" button is not challenging, but being able to barely pass under the bar is exciting. So, combat has to be difficult, right?
No, this is false. While D&D was designed around attrition, attrition does not imply challenge, nor does it imply fun. Your goal as the DM is to get everyone to have fun, and exciting combat is just one facet of that. And a party running low on resources going up against a seemingly powerful enemy is just one type of combat.
Rests are there to reset the attrition
At the end of the standard adventuring day, an adventurer should be exhausted of their resources and have nearly no HP left. Rests were put there to refill the players, reset the attrition, and have them go on the next adventuring day right away.
This goes back to modifying resting in D&D means you are modifying a core feature of the game. Shortening the rest period (the Epic Heroism variant, for example, allows 5-minute short rests and 1-hour long rests) means you want amoras attrition in your game, in that the player characters will have more opportunities to suffer this effect. Lengthening it (the Gritty Realism variant) means you want menos attrition.
At the end of the day, you are going to have to choose: do you want more attrition, or less? Once you answer this, you can go on to modify the length or a rest. But usually, you should not modify the length of the rest if your reason is not related to this aspect.
On failing to keep up the 6-8 encounters per day rule
Your concern is that long rest-based classes, particularly spellcasters, become unfairly advantaged over short rest-based classes, when the 6-8 encounter per day rule is not followed. This is not a reason to change the duration of your rests because it is a concern over class balance, and not about the intensity/frequency of attrition in your games.
Instead, you must realize that attrition does not mean the same as challenge. Fun combat is just one way to engage the players, and attrition-specific combat is only one type of combat you can run.
Combat focused on narrative
Consider these other types of combat, which can be engaging regardless of the current resources of the party:
A combat between the party and one of the party member's mother, who has been possessed by an NPC. There is no way to un-possess her without killing her, but she is hostile and is capable of killing the party.
A combat between the party and someone they hate, and have hated for so long that they are now just dying to kill this NPC. However, at the last minute, and possibly even after the NPC's death, they realize they were essentially Severus Snape -- a bad guy who did bad things for the right reasons, and who had been secretly helping the party all along.
A combat between two members of the party. This is in-character PvP, and it is always engaging (if your players are mature enough to handle the tension).
Balancing the short- and long- rest based classes
Your real problem here is the balance between classes, and not the duration of the rests. So you have to address your problems directly:
Nerf the spellcasters. Nerfing the players is generally not good, but if you want to keep them at the same power level as the short rest-based classes, this is one way. The cleanest way I have seen this done is keeping the player characters at unequal character levels: the casters are always one or two levels below the rest of the party. It didn't cause much issue in the game, but the caster did seem quite limited compared to the rest, and I think the player didn't enjoy it that much.
-
Buff the non-casters. The better solution is, of course, instead of nerfing the strong guy, you empower the weak guy. Try and give the weak player an item that would put them on par with the casters. How I've done this is I've assigned everyone in the party a different item, but each item actually evens out the DPR of all the player characters, if used optimally and in tandem with the character's abilities.
For example, I've given an Unearthed Arcana Warlock with the Moon Bow invocation a magic bow that would let her shoot an arrow as a bonus action, in the same campaign as I gave a Matt Mercer-style Gunslinger a 1-bullet pistol that had a +8 to-hit bonus, as well as a wand to a cleric that gave them double their spell slots and access to damaging-non cleric spells (it was a one-shot). Though I don't have my notes with me anymore, I calculated the DPS from all three characters to be roughly the same, taking into account Moon Bow's ability to smite with spell slots, and the Gunslinger's insane accuracy and Action Surge, and the cleric's access to new offensive spells.
Obviously, you will need to focus your campaign on more intense combat to justify giving your players items this powerful, but perhaps you can do better with weaker items.
Adopt Gritty Realism (if you also want less attrition), and just narrate over the long rests. This works really well because you don't have to manufacture anything new. Just tell the players, "you can do one major thing over your week of downtime, tell me what it is." And then move on from there. You will be able to follow the GR schedule nicely here by following this pattern: 2 encounters in a day, then sleep (short rest), and then 2 encounters the next day, and sleep (short rest), and a final 2 encounters, and downtime (long rest). GR really is fine without modification.
Conclusão
Your problem is not with the rest duration, but with class balance. Address the class balance issue by nerfing the casters or empowering the non casters. Change the rest duration only when you also have decided you want more/less attrition in your game, but recognize that changing the rest duration doesn't directly solve your problem.