When a novel hacking attack crippled parts of the Internet in October, it cut off consumers access to popular websites like Netflix and Kayak for hours at a time. For online retailers, the effect was the same as when a physical store shuts down: no customers and no sales. While hacking is not responsible for every website shutdown—an ordinary onslaught of customer traffic caused the online operations Target TGT 0.17% and Neimen Marcus to buckle last year — the threat is adding to retailers’ anxiety at a time when Internet sales are a critical growth area.