Bring a pot of salted water to a boil to cook the pasta.
Pour enough olive oil to cover the bottom of the frying pan. Heat it up over medium to high heat. The olive oil is ready once it starts to sizzle when dipping a zucchini slice in it.
Place enough of the zucchini slices into the frying pan so that they are not overlapping. You will need to fry the zucchini in several batches depending on the size of your frying pan. Fry for a couple of minutes until browned and then flip over to fry the other side. Once browned on both sides, remove from the pan and place on a dish lined with paper towels to absorb the excess oil. Repeat this for the remaining batches of zucchini slices.
Once the zucchini are done frying, pour out most of the olive oil into a separate bowl, leaving only a drizzle of olive oil left in the pan.
Place the spaghetti into the pot of boiling water and cook until al dente, or two minutes less than the package instructions.
Meanwhile, begin sautéing the garlic in the frying pan over medium to low heat to keep from burning.
Once the spaghetti is ready, scoop directly into the frying pan over low heat. If you must drain the pasta, make sure to reserve one cup of the water first. Add two ladleful's of the pasta water into the frying pan and the hot pepper flakes and continue to cook the pasta for about a minute while mixing.
Add about 1/2 cup of freshly grated caciocavallo cheese directly into the frying pan, or more if you prefer. Mix until the cheese has melted and then add in half of the fried zucchini. Continue cooking for about a minute.
Add in the basil and remove from heat. Serve with another sprinkle of the caciocavallo cheese .