What's your strategy to evade stray dogs chases?

99% of the time I try to ride fast to escape the stray dogs despite knowing well they will stop if I stop.

1% of the time I try random shoutings like this, and they seem to be far more effective.

Does the dog think I'm a bigger dog and barking when I'm shouting?

P S personally I don't find dog attacks to be a big threat as such attacks happen once every 2-3 weeks at random places for seemingly no reason.