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
Some interesting weather to start the weekend, with a yellow warning to "Be Aware" of heavy rain! But it will get better!
When a wave took a woman's false leg into the sea at Freshwater East, Gertie the dog knew she only had one chance - and leapt into action.
A nurse has been struck off for mocking dementia patients. Paris Roberts from Adamsdown worked at Atlantic View care home in Cardiff Bay.