Yep the lymphs can swell because of infection but also when they are in a fight against an agressor, like AS or autoimmune diseases.
You may have an accompanying illness such as Sjogrens Syndrome. It is not unkown among AS'ers.
That would be the Parotid glands swelling in that case and this disease also flares and remits. Sometimes the lymphs are letting you know your body has an invader ...and that may be your ownself.