We start by reviewing the computation of the partition function of a massless scalar field in the large volume limit, which corresponds to a spacetime manifold of the form S^1\times R^3, using 3 different methods: functional integration with zeta function regularization, Hamiltonian operator quantization, and heat-kernel/proper time/worldline methods. We then discuss the modifications of this computation for a spacetime manifold of the form T^2\times R^{d-1}, which is the case relevant for Casimir physics when d=2. The result is simply expressed in terms of a real analytic Eisensten series after turning on a chemical potential for linear momentum in the compact spatial direction. How to recover the standard conformal field theory result in d=1 is briefly discussed. Temperature inversion symmetry and modular covariance are derived. As a consequence, the entropy for photons in a Casimir box is shown to scale with the area of the plates at low temperature.