During Robert Riley's sentencing, chairwoman of the bench Georgina Scannell voiced her disgust at his "vile" and "offensive" online messages.
The offensive messages outraged the public. You had complete disregard for the tragic death of Ann Maguire.
Besides this, countless other vile messages were made by you.
The bench finds these were racially and religiously aggravated.
The offences are so serious that only a period of immediate custody can be justified.
More top news
After weeks of doubt, Joe Ledley has been included in Wales' twenty-three-man squad for next month's Euro 2016 finals.
Hundreds of fans have signed a petition calling for football fanzones in Wales so supporters at home can share in the atmosphere.
Celebrity adventurer Bear Grylls has joined forces with Welsh Scouts to encourage more adults to volunteer with the organisation.