Asking reference letter earlier or later if I need to go mandatory service for my country I'm currently working in a research institution as a RA, and I'm thinking of asking my professor for recommendation letter for PhD application. But because of mandatory national service in my home country, I have to go back and serve my country for 2 years before going into PhD. In that duration of 2 years, I'll have minimum contact with my professor, if anything. 

Should I ask for a recommendation now, given that his memory of me is much more fresh, or should I ask him after I'm done with my mandatory national service, at which I will be applying?

I've heard both cases of arguments: 

Pros of asking earlier


Professor will forget the minute details about my projects and my skill (two years isn't that long, but I don't think it's short either, given that he has interaction with many other RAs and students)
It will give him plenty (perhaps too much?) of time to write the recommendation letter when he is free.
It is more likely that he will write a letter for someone that is working for him now, then someone that has worked for him in the past, since he does not have to see me when he rejects my request, but it will be awkward if he rejects my request now when I still work for him. 


Pros of asking later


Professor may fear that I may decide not to pursue PhD after that duration has past, and his effort in that letter might be in vain. While I'm confident that I'll apply after that 2 years has past, I cannot give a proof to him.
If I've accomplished anything during the time I was away, then he would like to put it in the letter. In my case, I'm doubtful if I can do any academic work when I'm serving my country, but who knows. 


I'd like to hear if there are any other reasons to favor one option over the other, and ultimately to know which option to take.

I've seen related question: Letter of Rec. for future University application but this is quite irrelevant since most answers deal with the question of asking the police chief for letter.

This is also related, but my circumstance is different from the OP in this post.
I would suggest explaining your situation to the professor and asking him to write the letter now.

Later on, if you do manage to do some extra work you can ask him to revise the reference letter. The revisions will be quick and easy, but writing a reference letter from scratch after two years might be difficult.

The professor should not be disappointed if he writes the letter but you decide not to continue in academia. A good reference letter will also be very useful when applying for other jobs.