{"id":325374,"date":"2020-11-10T07:35:05","date_gmt":"2020-11-10T15:35:05","guid":{"rendered":"https:\/\/css-tricks.com\/?p=325374"},"modified":"2020-11-10T07:35:11","modified_gmt":"2020-11-10T15:35:11","slug":"netlify-background-functions","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/netlify-background-functions\/","title":{"rendered":"Netlify Background Functions"},"content":{"rendered":"\n
As quickly as I can:<\/p>\n\n\n\n
-background<\/code> to the filename like my-function-background.js<\/code>. (You can write in Go also.)<\/li>- This means you can do long-ish running tasks, like spin up a headless browser and scrape some data, process images to build into a PDF and email it, sync data across systems with batch API requests… or anything else that takes a lot longer than 10 seconds to do.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"
As quickly as I can: AWS Lambda is great: it allows you to run server-side code without really running a server. This is what “serverless” largely means. Netlify Functions run on AWS Lambda and make them way easier to use. For example, you just chuck some scripts into a folder they deploy when you push […]<\/p>\n","protected":false},"author":3,"featured_media":325375,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[4],"tags":[1504,1415,3126,1024],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/11\/background-functions.png?fit=1500%2C1040&ssl=1","jetpack-related-posts":[{"id":270959,"url":"https:\/\/css-tricks.com\/forms-auth-and-serverless-functions-on-gatsby-and-netlify\/","url_meta":{"origin":325374,"position":0},"title":"Forms, Auth and Serverless Functions on Gatsby and Netlify","date":"May 31, 2018","format":false,"excerpt":"Abstracting infrastructure is in our DNA. Roads, schools, water supply networks\u2014you get the idea. Web development is no exception: serverless architectures are a beautiful expression of that phenomenon. Static sites, in particular, are turning into dynamic, rich experiences. Handling static forms, authentication, and backend functions on statically-generated sites is now\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/05\/gatsby-netlify.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":293530,"url":"https:\/\/css-tricks.com\/using-netlify-forms-and-netlify-functions-to-build-an-email-sign-up-widget\/","url_meta":{"origin":325374,"position":1},"title":"Using Netlify Forms and Netlify Functions to Build an Email Sign-Up Widget","date":"August 2, 2019","format":false,"excerpt":"Building and maintaining your own website is a great idea. Not only do you own your platform, but you get to experiment with web technologies along the way. Recently, I dug into a concept called serverless functions, starting with my own website. I\u2019d like to share the results and what\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/netlify-icons.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":269355,"url":"https:\/\/css-tricks.com\/static-file-hosting-doesnt-have-to-be-so-static\/","url_meta":{"origin":325374,"position":2},"title":"Static File Hosting Doesn\u2019t Have To Be So\u2026 Static","date":"April 5, 2018","format":false,"excerpt":"A huge high-five and welcome to Netlify for the sponsorship this week. If you haven't heard of Netlify, the big thing you should know is that it's web hosting, but more than that. It's web hosting with the developer workflow squarely at heart. You can spin up a site on\u2026","rel":"","context":"In "Sponsored"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/04\/netlify.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":286226,"url":"https:\/\/css-tricks.com\/netlify-functions-for-sending-emails\/","url_meta":{"origin":325374,"position":3},"title":"Netlify Functions for Sending Emails","date":"April 23, 2019","format":false,"excerpt":"Let's say you're rocking a JAMstack-style site (no server-side languages in use), but you want to do something rather dynamic like send an email. Not a problem! That's the whole point of JAMstack. It's not just static hosting. It's that plus doing anything else you wanna do through JavaScript and\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2018\/11\/email-open-cloe.gif?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":292959,"url":"https:\/\/css-tricks.com\/lets-build-a-jamstack-e-commerce-store-with-netlify-functions\/","url_meta":{"origin":325374,"position":4},"title":"Let’s Build a JAMstack E-Commerce Store with Netlify Functions","date":"August 20, 2019","format":false,"excerpt":"A lot of people are confused about what JAMstack is. The acronym stands for JavaScript, APIs, and Markup, but truly, JAMstack doesn\u2019t have to include all three. What defines JAMstack is that it\u2019s served without web servers. If you consider the history of computing, this type of abstraction isn\u2019t unnatural;\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/08\/ecommerce-demo.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":334381,"url":"https:\/\/css-tricks.com\/netlify-2\/","url_meta":{"origin":325374,"position":5},"title":"Netlify","date":"February 16, 2021","format":false,"excerpt":"High five to Netlify for the \u2765 sponsorship. Netlify is a great place to host your static (or not-so-static!) website because of the great speed, DX, pricing, and feature set. I've thought of Netlify a bunch of times just in the past week or so, because either they release something\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/07\/netlify-newsletter.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"featured_media_src_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/11\/background-functions.png?fit=1024%2C710&ssl=1","_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/325374"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=325374"}],"version-history":[{"count":2,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/325374\/revisions"}],"predecessor-version":[{"id":325410,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/325374\/revisions\/325410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/325375"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=325374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=325374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=325374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}