Live data from Hacker News

Squarespace Announces Local Development Server

engineering.squarespace.com

11–20 of 41 posts

Re: Squarespace Announces Local Development Server

#11
post #8

> The first time you access a local template, it will take a while to load as the server fetches the site content. However, once the content has been cached, subsequent requests will complete more quickly until you terminate the server. If you need to invalidate the cache (because you’ve updated your website in the online editor, for example) you can use the ?nocache=true query parameter on any URL. Why would a devel…

>Why would a developer want to see a cached version of a page? A developer using this is actively developing the look and feel of the site so presumably would want to see the live version. This makes no sense and would only cause issues ("But it looked fine when I tested it locally a minute ago?!").

The assumption is that developers are concerned with the look and feel, client/owners are concerned with content.

Re: Squarespace Announces Local Development Server

#12
post #10
post #8

> The first time you access a local template, it will take a while to load as the server fetches the site content. However, once the content has been cached, subsequent requests will complete more quickly until you terminate the server. If you need to invalidate the cache (because you’ve updated your website in the online editor, for example) you can use the ?nocache=true query parameter on any URL. Why would a devel…

I'm not a 100% sure but when I've used similar tools like this before the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page. Do you really need the contents of the newest blog posts to be pulled in each time you want to test a CSS layout change?

> I'm not a 100% sure but when I've used similar tools like this before the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page.

Is this rendering the page remotely and fetching it? If so, it seems like the only point would be to reduce the server load on their end.

> Do you really need the contents of the newest blog posts to be pulled in each time you want to test a CSS layout change?

You would need something. At the minimum a "Lorem ipsum ..." to see how the text flows. What better than the real content for that? Especially if you already have it.

Re: Squarespace Announces Local Development Server

#15
post #12
post #10

Earlier quoted context omitted.

I'm not a 100% sure but when I've used similar tools like this before the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page. Do you really need the contents of the newest blog posts to be pulled in each time you want to test a CSS layout change?

> I'm not a 100% sure but when I've used similar tools like this before the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page. Is this rendering the page remotely and fetching it? If so, it seems like the only point would be to reduce the server load on their end. > Do you really need the contents of the newest blog posts to be pul…

> Is this rendering the page remotely and fetching it? If so, it seems like the only point would be to reduce the server load on their end.

No. From the very line you quoted:

> ... the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page.

> What better than the real content for that?

Nothing, which is why that's what they do. They figure that the content of the page as it exists when you first load the development server is sufficient, and so cache that content. It seems unnecessary to me to have my development server update the content if a new post goes to production in the middle of my work.

Re: Squarespace Announces Local Development Server

#16
post #8

> The first time you access a local template, it will take a while to load as the server fetches the site content. However, once the content has been cached, subsequent requests will complete more quickly until you terminate the server. If you need to invalidate the cache (because you’ve updated your website in the online editor, for example) you can use the ?nocache=true query parameter on any URL. Why would a devel…

Hi, I worked on this at Squarespace.

> Why would a developer want to see a cached version of a page?

Squarespace is a CMS. There's an online content editor where users can add text and images. The content is rendered using a template which contains the HTML/CSS/Template code that defines the layout for the content. The squarespace dev server makes it easier for the developer to work on the template code using content from the live site. I don't think you'd run into a situation where it looked fine locally but broke in production, because the content will be the same.

> why not just make it a portable executable for each platform

NPM has great cross-platform support, and it's used by lots of web developers. That's why we chose NPM. It allowed us to build a cross-platform tool without having to maintain lots of separate installers for various platforms.

Also we wanted to take advantage of the same java based template and less compilers that we use in production (that are open source), which is a large part of why we used java. I'll admit it's not a natural choice for an NPM package, but it's working well for us so far.

Re: Squarespace Announces Local Development Server

#17
post #9

I had been using an open source variant of this the last few months, which ironically has a similar approach - https://github.com/NodeSquarespace/node-squarespace-server This is amazing news though! Hoping the next step is to expose a content manipulation api :)

Same here. This was built by an outstanding outside dev who was using all sorts of undocumented methods to extract content and render a Squarespace template. That server has been awesome, but in order for it to continue to work the project dev had to maintain a JavaScript recreation of Squarespace's templating engine. This new dev server seems to run the same engine they use in the development environment. It works insanely well, even with some of the most complex stuff I've throw at it.

Re: Squarespace Announces Local Development Server

#18
post #12

Earlier quoted context omitted.

> I'm not a 100% sure but when I've used similar tools like this before the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page. Is this rendering the page remotely and fetching it? If so, it seems like the only point would be to reduce the server load on their end. > Do you really need the contents of the newest blog posts to be pul…

> Is this rendering the page remotely and fetching it? If so, it seems like the only point would be to reduce the server load on their end. No. From the very line you quoted: > ... the cached data coming from the web is the _content_ of the page, where the checked out repo I'm in is dealing with the _layout_ of the page. > What better than the real content for that? Nothing, which is why that's what they do. They fig…

Ah misunderstanding on my part. I considered the entire page itself to be "content" and didn't realize they were referring to just fetching the copy. Makes much more sense now.

Re: Squarespace Announces Local Development Server

#19

Next up an open source version that lets us host our own version without being trapped in their environment. Once that exists I'd see Squarespace as a viable option for hosting a website. Until then it's just another proprietary WYSIWYG website builder that I don't care about. It's competing in a world where Wordpress is open source and is powering over 26% of the world's websites: https://w3techs.com/technologies/ov…

Squarespace is way too locked down. They advertise it as a great eCommerce platform and people come to us all the time already having setup a Squarespace store asking if we can pull their orders for fulfillment. It either has to be done manually or they force you to use ShipStation. Terribly inflexible for a webstore and I always steer people away as soon as possible. But hey, they got that sweet sweet exclusivity agreement so who actually cares about usability or the paying customer, right?
Post reply on HN