July 31 2016, 22:55

Update on my blog about Hybris. This is the third article on the topic of caching page parts to stabilize performance under heavy traffic for an e-commerce site.

Alexey Pasynkov, thanks for the idea! It took a bit of effort to get it to work on Windows, but ultimately it was successful.

Briefly about the working principle. A reverse proxy NGINX is placed between the user and Hybris. All requests go to it, and it redirects them to Hybris if necessary. Caching means that sometimes it does not do this, so the page suddenly loads much faster.

When requesting, say, the main page, Hybris renders all components for the first time, but instead of immediately delivering the result to the client’s browser, it stores the resulting html in the cache for a specified number of seconds (depends on the cached area, set manually). Then, Hybris returns the page to the user, but all these areas with components, now in the cache, are replaced in the output HTML with special tags, which are intercepted by NGINX. If these tags reached the user’s browser, the browser would not know what to do with them, but here the gadget in the middle, through which these tags pass, comes to the rescue. Seeing the tags, NGINX requests the same cache where these fragments were stored and inserts the result instead of the tags, and the shopper’s browser sees everything as it would be without any caching. Only on average much faster. If the first time this will work a bit longer than without any caching, then on the second and subsequent times it will work significantly faster, since Hybris will no longer be formulating a good half of the page, and it will be pulled from the cache even before Hybris by NGINX.

Overall, I’ve almost told everything here, but the article contains some more details and a picture.

Erik Babadzhanov Renata Mussina Maxim Antonov Marina Zhigalova Alexey Lyubimov

July 31 2016, 13:02

A very notable video presentation by Musk about the completion of the first phase of their battery manufacturing plant, Gigafactory. The plant is located in the Nevada desert (no water, no vegetation, populated by robots), far from major human habitats. Their concept: machine that builds the machine: raw material input –> bunch of stuff happened –> finished goods output. Obviously, the factory will be serviced by a small crew of technicians… and security. That’s it. Interesting considerations about the useful area of the factory. Essentially, this huge volume, as detailed in the presentation, is literally packed to the brim with equipment.

The second interesting point: if you remove the voice and video inserts from the presentation, and for a moment forget that it’s Musk speaking, then the presentation resembles some report at a tech conference about another web startup. Cheers from the audience and the setting are not at all meant for PR. What matters is what they say and show, not how they say and show it. Compare this to the presentations by Steve Jobs, which many consider a benchmark.

“How big is this factory?”

“Well, you can fit about 50 billion hamsters in here, that’s how big.”