Wash, peel, and core apples. Chop them into 1-inch chunks.
Add chopped apples to a large bowl and add lemon juice and lemon zest. Stir to combine.
Place a medium saucepan over medium heat and add water, white sugar, brown sugar, cinnamon, nutmeg, cloves, allspice, cornstarch, and salt. Stir to combine until the cornstarch is dissolved.
Bring to a boil while stirring often, and boil for 2-3 minutes.
Add the apples, reduce heat from medium to low, cover saucepan with a lid and let the apples simmer for 6-8 minutes, or until apples have softened, but are not mushy. Stir often.
If the filling is too watery for your taste, in a small bowl mix 2 tablespoons of cornstarch with 2 tablespoons of water until fully dissolved and add the slurry to the filling, simmer for 2 minutes to thicken. Keep in mind that the filling will thicken more once completely cooled, so while it may look a bit watery when hot it will thicken more when chilled.
Remove from heat and stir in the butter if using.
Cool it to room temperature, transfer it to an airtight container or jars and refrigerate. The mixture will thicken more as it cools.