<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ctln88</title>
    <description>The latest articles on DEV Community by ctln88 (@ctln88).</description>
    <link>https://dev.to/ctln88</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F899712%2F8966ce0a-ea32-405d-8338-a15bb3b4596f.jpg</url>
      <title>DEV Community: ctln88</title>
      <link>https://dev.to/ctln88</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ctln88"/>
    <language>en</language>
    <item>
      <title>The Top Five Free Tools to Improve Your Website Today</title>
      <dc:creator>ctln88</dc:creator>
      <pubDate>Thu, 20 Oct 2022 15:34:12 +0000</pubDate>
      <link>https://dev.to/ctln88/the-top-five-free-tools-to-improve-your-website-today-43k3</link>
      <guid>https://dev.to/ctln88/the-top-five-free-tools-to-improve-your-website-today-43k3</guid>
      <description>&lt;p&gt;Are you a newbie website developer looking for free tools to improve your website? Look no further.&lt;/p&gt;

&lt;p&gt;I’ve been building a &lt;a href="https://www.simplefileupload.com/"&gt;website&lt;/a&gt; for the past year, and it’s a lot harder than I thought it would be! There are several “tricks of the trade” that no one tells you about. How do you write concise content? What about search engine optimization (SEO)? &lt;/p&gt;

&lt;p&gt;Below are my favorite free tools that I use to improve the design, content, and SEO of my website.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Swipewell Marketing Examples
&lt;/h2&gt;

&lt;p&gt;Need website design inspiration? Design is still tough for me especially because I don’t have a traditional background in web development. To spark inspiration, I use these &lt;a href="https://www.swipewell.app/examples"&gt;marketing examples&lt;/a&gt; by Swipewell. Find examples of numerous web pages including about, pricing, and landing pages. In fact, I built this &lt;a href="https://www.simplefileupload.com/uploadcare-alternative"&gt;landing page&lt;/a&gt; based on an example SaaS competitor comparison page from Swipewell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--828VGA7X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1xl68bwg5l08v3yr6xn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--828VGA7X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1xl68bwg5l08v3yr6xn.png" alt="Image description" width="880" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No need to reinvent the wheel. Use Swipewell to quickly search for relevant marketing examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Hemingway Editor
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://hemingwayapp.com/"&gt;Hemingway Editor&lt;/a&gt; is my secret to writing clear, concise content. Simply, copy and paste your text to the app. The editor will then highlight in &lt;strong&gt;yellow&lt;/strong&gt; any difficult-to-read sentences. It will highlight in &lt;strong&gt;red&lt;/strong&gt; any very difficult-to-read sentences. Additionally, it highlights adverbs, passive voice, and phrases with easier-to-understand alternatives.&lt;/p&gt;

&lt;p&gt;The editor also gives your writing a “readability” score based on grade level. You may think writing at a higher grade level is best. But, it often means more complicated writing that will be difficult for the reader to follow. I always try to aim for Grade 6 readability or less.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8BhT3bSn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lj089g87mviswmkliaeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8BhT3bSn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lj089g87mviswmkliaeu.png" alt="Image description" width="880" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a great tool to use to shorten and clarify any content on your website, especially landing page copy. The more concise you can make your landing page copy, the easier it’ll be for your reader to understand. Concise copy also makes it more likely that a reader will keep reading instead of bouncing due to frustration.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Undraw Illustrations
&lt;/h2&gt;

&lt;p&gt;Let’s be clear, I understand that websites should include images relevant to your business or product. But, that’s not always easy to do. That’s why I use &lt;a href="https://undraw.co/"&gt;Undraw&lt;/a&gt; for any stock illustrations that I need.&lt;/p&gt;

&lt;p&gt;Undraw lets you search for any illustrations that you want! You can also change the color of the images to match your existing website UI. The images are clean and classic, perfect for any website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q_JcnPMG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q0rwdqcwtqo3ax63bom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q_JcnPMG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q0rwdqcwtqo3ax63bom.png" alt="Image description" width="880" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Undraw is also an open-source platform, so you can use any of their illustrations for free. No need for attribution either (of course, unless you want to!) Fun fact, the illustration for this blog post is from Undraw.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Google Lighthouse
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.chrome.com/docs/lighthouse/overview/"&gt;Lighthouse&lt;/a&gt; is a free, open-source tool. It rates website performance, accessibility, best practices, SEO, and progressive web app (PWA) on a scale of 0 to 100. &lt;/p&gt;

&lt;p&gt;The easiest way to use Lighthouse is to install it as a Chrome extension. Navigate to the website you want Lighthouse to review and click generate a report. Ta-da! It creates a free report with your website scores. Click on each score to see suggestions for improvement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_ZxBOlHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y1ovb5yq5w5vcashrjh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_ZxBOlHs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y1ovb5yq5w5vcashrjh5.png" alt="Image description" width="603" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don’t worry about scoring 100 in every category. Take the Lighthouse scores with a grain of salt and fix any issues that you can. I like to use Lighthouse to find any major issues with my website.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. AHREFs
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://ahrefs.com/"&gt;AHREFs&lt;/a&gt; is an “all-in-one SEO toolset” that you can buy to improve your website's SEO. But, there’s a secret. AHREFs offers a &lt;a href="https://ahrefs.com/website-checker"&gt;free website checker tool&lt;/a&gt;. First, input your website address. The tool will then check for website health, performance issues, technical problems, and SEO issues.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X4z2SaJd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vcmesm2zhhk182v5hzwe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X4z2SaJd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vcmesm2zhhk182v5hzwe.png" alt="Image description" width="880" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the best free SEO tool I’ve found! It provides extensive information in an easy-to-read format. If you’re not quite ready to pay for an SEO tool, I recommend checking it out.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Caitlin Fithian spent over 10 years working as an environmental consultant before becoming a SAHM in 2020. She is working to make a career change to tech. Currently, she works part-time for &lt;a href="https://www.simplefileupload.com/"&gt;Simple File Upload&lt;/a&gt; as a marketing strategist. Follow her journey here or on &lt;a href="https://twitter.com/Caitlin_Fithian"&gt;Twitter&lt;/a&gt; as she learns more about marketing and no code while raising two small kids.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>webdesign</category>
      <category>tooling</category>
    </item>
    <item>
      <title>The Benefits of a SaaS Marketplace</title>
      <dc:creator>ctln88</dc:creator>
      <pubDate>Tue, 09 Aug 2022 01:49:58 +0000</pubDate>
      <link>https://dev.to/ctln88/the-benefits-of-a-saas-marketplace-18d1</link>
      <guid>https://dev.to/ctln88/the-benefits-of-a-saas-marketplace-18d1</guid>
      <description>&lt;p&gt;Why do most developers build SaaS products? To solve their own problems. But what if you also want to sell your SaaS product? Where do you start? The answer, an existing SaaS marketplace. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is a SaaS Marketplace?
&lt;/h2&gt;

&lt;p&gt;A SaaS marketplace is a platform that offers cloud-based extensions to its users. These extensions are often referred to as applications, add-ons, or plugins. The purpose of these extensions is to supplement an existing product. Or, provide developers with an easier way to build their products. These extensions can be free or paid. &lt;/p&gt;

&lt;p&gt;For example, &lt;a href="https://www.heroku.com/"&gt;Heroku&lt;/a&gt; is a platform as a service (PaaS). It enables developers to build applications. Heroku provides an &lt;a href="https://elements.heroku.com/"&gt;elements marketplace&lt;/a&gt;. This is where developers can buy add-ons, buttons, or build packs. These tools help developers build applications faster and easier. &lt;/p&gt;

&lt;p&gt;What are the benefits of launching your SaaS product on an existing marketplace like Heroku? Let's find out.  &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Built-In Distribution Plan
&lt;/h2&gt;

&lt;p&gt;Marketing is often described as the hardest part of SaaS entrepreneurship. You're not a marketer, you're a developer. It's difficult to know how to organically market your product to users. &lt;/p&gt;

&lt;p&gt;A SaaS marketplace can provide you with a built-in distribution plan. Heroku is a well-known, reputable marketplace with existing website traffic. You can take advantage of that traffic by listing your product in a relevant marketplace category. Ta-da, your product is instantly searchable on an established website. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Customer Validation
&lt;/h2&gt;

&lt;p&gt;There are three add-on &lt;a href="https://devcenter.heroku.com/articles/bringing-an-add-on-to-market"&gt;release stages&lt;/a&gt; when you launch a product to Heroku: alpha, beta, and general availability (GA). &lt;/p&gt;

&lt;p&gt;The first stage is the alpha stage. At this stage, your product is only available to you and individuals that have been given access. These individuals are likely product testers that you've asked to trial your product and provide feedback. During the alpha stage, your product is not yet publicly available in the Heroku marketplace. &lt;/p&gt;

&lt;p&gt;The next stage is the beta stage. To advance to the beta stage, you must have at least 15 users that have tested your product. Now, your product can be publicly listed on the Heroku marketplace as a free trial. During the beta stage, it's a good idea to continue to ask for feedback and improve your product. &lt;/p&gt;

&lt;p&gt;The final stage is general availability (GA). Before you can move on to the GA stage, you must have at least 100 users that have tested your product. Now that your product has been tested and validated, you can start charging users. Congratulations! &lt;/p&gt;

&lt;p&gt;Why does this multi-stage release system work? It requires that at least 100 users test your product before you can sell it. Thus, it's reasonable to assume you've found a good product-market fit. &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Cost-Benefit Analysis
&lt;/h2&gt;

&lt;p&gt;Marketing is expensive. According to a &lt;a href="https://www.before.io/resources/how-much-do-saas-companies-spend-on-marketing"&gt;2022 SaaS Marketing Guide&lt;/a&gt;, the average SaaS company spends between 15% to 25% of its annual revenue on marketing. If you're trying to launch your first SaaS product or a side project with no revenue, this cost is likely not manageable. &lt;/p&gt;

&lt;p&gt;Why not tap into an existing customer base for free? Heroku already has customers that use its service. These customers are looking for products to enhance their applications. You win, and the customer wins. No need to launch your product into the abyss of the internet. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Simple User Integration
&lt;/h2&gt;

&lt;p&gt;Heroku users need Heroku-specific solutions that are easy to install and set up. The first place that Heroku users will look to solve their problems is the existing marketplace. These products will be easier to use and faster to install. &lt;/p&gt;

&lt;p&gt;For example, Heroku uses containers called "dynos." Dynos have ephemeral filesystems. This means that files that are not part of an application's slug are lost when a dyno is restarted or replaced. If you design a product that integrates with Heroku's ephemeral filesystem, then you've solved a Heroku-specific problem for users. &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Easy Billing Process
&lt;/h2&gt;

&lt;p&gt;Have you thought about how you're going to bill customers for your product? What about billing security? When you launch your product on Heroku, billing is taken care of for you. &lt;/p&gt;

&lt;p&gt;Heroku allows you to price your product as a monthly subscription. You're able to add varying tiers to this subscription. Your customers will be automatically billed each calendar month. Heroku will also pro-rate any billing if a product was used for less time than the entire month. &lt;/p&gt;

&lt;p&gt;No need to write and integrate complicated billing code. Let someone else handle the headache of billing for you. &lt;/p&gt;

&lt;h2&gt;
  
  
  Is an existing marketplace right for you?
&lt;/h2&gt;

&lt;p&gt;Marketing takes time and money that you may not have. This is especially true if you're launching your first SaaS product or a side project.&lt;/p&gt;

&lt;p&gt;Marketing also requires learning a new skill that may not interest you. Let's be honest, marketing is hard work, and it's not for everyone. If your passion is building products, then let a marketplace take care of the heavy lifting for you. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>saas</category>
      <category>marketing</category>
      <category>saasmarketing</category>
    </item>
    <item>
      <title>The Complete Guide to using a CDN with Rails Active Storage</title>
      <dc:creator>ctln88</dc:creator>
      <pubDate>Mon, 08 Aug 2022 20:39:23 +0000</pubDate>
      <link>https://dev.to/simplefileupload/the-complete-guide-to-using-a-cdn-with-rails-active-storage-3po</link>
      <guid>https://dev.to/simplefileupload/the-complete-guide-to-using-a-cdn-with-rails-active-storage-3po</guid>
      <description>&lt;p&gt;In Rails versions prior to 6.1, Rails Active Storage only served files from an expiring URL that redirected to the selected service. This made it impossible to serve the files via a CDN. There were many workarounds to this problem, and fortunately Rails introduced the new proxy features for serving files from Active Storage in Rails 6.1.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the proxy feature do?
&lt;/h2&gt;

&lt;p&gt;The proxy feature provides a permanent URL to an asset through your Rails application instead of an expiring URL. This enables you to put a CDN between your application and the browser. When a user requests an asset from your site the architecture looks like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ixWEFLh2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sln8x2slrpdh5qwgxhwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ixWEFLh2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sln8x2slrpdh5qwgxhwg.png" alt="CDN_architecture" width="880" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first time an asset is requested, it will be served by your application. On all subsequent requests, it will be served from the CDN. To test this, access a file served by Active Storage. Here is one as an example: &lt;a href="https://test.resize-files-simplefileupload.com/fuMNP7ovtCqXHzC2o-tik00U1QsOgwKgTWtvGOM_y1M/plain/s3://static.files-simplefileupload.com/ktwvbr39vdni3dr2vivl3g0iz0us"&gt;View this link to see a proxied URL.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open the “Network” tab in developer tools and request the resource again (i.e. refresh the page). You can see HIT in the cache headers, showing the file was served from a CDN, not from your application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7enhV3L4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/di9ubmla3hq2kd13gvyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7enhV3L4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/di9ubmla3hq2kd13gvyp.png" alt="cache_hit" width="880" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is this important?
&lt;/h2&gt;

&lt;p&gt;A lot of the workarounds the community was doing before Rails 6.1 involved creating a direct URL using the object key and the desired CDN domain. There were a few problems with this. &lt;/p&gt;

&lt;p&gt;First of all, if you were serving public files from S3, the storage providers usually required the domain name and the bucket name to be identical. This really became a problem if you were using wildcard subdomains. &lt;/p&gt;

&lt;p&gt;Also, it made it tricker to switch storage providers. It was possible, but there were necessary DNS changes and the buckets still had to conform to the specified naming conventions. &lt;/p&gt;

&lt;p&gt;With the new proxy feature switching storage providers is as easy as updating &lt;code&gt;storage.yml&lt;/code&gt; in your Rails application. You can also now easily use wildcard subdomains and have more freedom in naming your buckets.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you add a CDN to Rails active storage?
&lt;/h2&gt;

&lt;p&gt;Assuming you have Active Storage set up and you’re trying to add a CDN, all you need to do is update your routing and serving of files.&lt;/p&gt;

&lt;p&gt;In your &lt;code&gt;storage.yml&lt;/code&gt;, add the &lt;code&gt;public:true&lt;/code&gt; setting to your configuration if you haven’t already done so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kRqeESS8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uta8cgjoep5lzb3cwgck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kRqeESS8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uta8cgjoep5lzb3cwgck.png" alt="add_CDN_code_block" width="880" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a standard Active Storage configuration, you serve the file using &lt;code&gt;&amp;lt;%= image_tag(@user.avatar) %&amp;gt;&lt;/code&gt; (for example). &lt;/p&gt;

&lt;p&gt;This provides you an expiring URL that redirects to your storage service. You’ll notice the URL typically has the word “redirect” in the path. &lt;/p&gt;

&lt;p&gt;Using the default Active Storage serving service, the URL will look like the one below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;a href="http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6I-kJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19%E2%80%93c5090cc1490554569fbdd6a90ad0f99ae1f416e8/matthijs-van-schuppen-8jGB-ud8MtI-unsplash.jpg"&gt;http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6I-kJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19–c5090cc1490554569fbdd6a90ad0f99ae1f416e8/matthijs-van-schuppen-8jGB-ud8MtI-unsplash.jpg&lt;/a&gt;"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice the &lt;em&gt;blobs/redirect&lt;/em&gt; string in the URL. If you click an expiring URL it will redirect to your bucket and eventually expire. Which means it can’t be cached by a CDN.&lt;/p&gt;

&lt;p&gt;To use a CDN, you need to change the URL to be permanent. One way to do this is to modify the &lt;code&gt;routes.rb&lt;/code&gt; file and use the route directly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N0HHghEu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/10plpey7ovqgx2dbx7jj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N0HHghEu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/10plpey7ovqgx2dbx7jj.png" alt="modify_routes_file_code_block" width="880" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In your view you can now use &lt;code&gt;&amp;lt;%= image_tag cdn_image_url(@user.avatar) %&amp;gt;&lt;/code&gt;. If you look at the generated URL, you will see it now contains the string &lt;code&gt;blob/proxy&lt;/code&gt; and when you click it you are not redirected to the bucket/key endpoint:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“&lt;a href="http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJ-BaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19%E2%80%93c5090cc1490554569fbdd6a90ad0f99ae1f416e8/matthijs-van-schuppen-8jGB-ud8MtI-unsplash.jpg%E2%80%9D"&gt;http://localhost:3000/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJ-BaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19–c5090cc1490554569fbdd6a90ad0f99ae1f416e8/matthijs-van-schuppen-8jGB-ud8MtI-unsplash.jpg”&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you don’t have your CDN set up at this point, you can use your app host in the &lt;code&gt;CDN_HOST&lt;/code&gt; variable, and the assets will still resolve correctly. &lt;/p&gt;

&lt;p&gt;With the setup just described, you can still use the redirect URL alongside the &lt;code&gt;cdn_url&lt;/code&gt; as needed. The following routes both work. The first produces the redirect URL, and the second produces the proxy URL.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;%= image_tag (@user.avatar)%&amp;gt;&lt;/code&gt; creates a redirect URL&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;%= image_tag cdn_image_url(@user.avatar) %&amp;gt;&lt;/code&gt; creates a proxy URL&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What if I want to proxy all my files?
&lt;/h2&gt;

&lt;p&gt;If you want to proxy all your files, you can add an initializer to your application. Create an &lt;code&gt;active_storage.rb&lt;/code&gt; file in &lt;code&gt;config/initializers&lt;/code&gt; with the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rails.application.config.active_storage.resolve_model_to_route = :rails_storage_proxy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can then remove the &lt;code&gt;cdn_routes&lt;/code&gt; created in the previous step, and all files will use the proxy URL. So in this case with one additional line in the configuration a standard &lt;code&gt;&amp;lt;%= image_tag (@user.avatar), width: 500, height: 500 %&amp;gt;&lt;/code&gt; will produce a proxy URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the route helpers?
&lt;/h2&gt;

&lt;p&gt;Another option is to use route helpers directly. With no &lt;code&gt;active_storage.rb&lt;/code&gt; configuration and no &lt;code&gt;cdn_image&lt;/code&gt; routes defined, you can use &lt;code&gt;&amp;lt;%= image_tag rails_storage_proxy_path(@user.avatar), height: 100, width: 100 %&amp;gt;&lt;/code&gt; directly in your view to generate the proxy URL. &lt;/p&gt;

&lt;p&gt;This helper accepts parameters, so you can specify your CDN host if desired: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;rails_storage_proxy_url(@user.avatar, host: Rails.application.credentials.dig(:CDN_HOST), protocol: “https")&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I connect my CDN to my application?
&lt;/h2&gt;

&lt;p&gt;The architecture for the complete DNS and CDN setup for the application will look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vnMBxXw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s54c5fgoal4g4manp29h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vnMBxXw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s54c5fgoal4g4manp29h.png" alt="CDN_advanced_architecture" width="880" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I configure a CDN?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Select a CDN.&lt;/strong&gt; For this article, we’ll use the &lt;a href="https://devcenter.heroku.com/articles/expeditedcdn"&gt;Expedited CDN&lt;/a&gt; provided in the Heroku application store. We’ll also deploy the application with Heroku. If using Heroku, add your custom domain to your Heroku application. This is available on the Settings tab of your Heroku application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--niE0MJm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adqivr7b3xxoftgq3ueb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--niE0MJm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adqivr7b3xxoftgq3ueb.png" alt="custom_domains_heroku" width="880" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add the target to your DNS provider.&lt;/strong&gt; After you add a custom domain with Heroku, Heroku will provide you a DNS record. Add this record to your domain's DNS configuration. Here’s an example of what that might look like with NameCheap as a DNS provider:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4dXvqA9V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olm5dtvqljim4ceco8zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4dXvqA9V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olm5dtvqljim4ceco8zw.png" alt="add_target_to_DNS" width="880" height="77"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complete the Setup of Expedited CDN or the CDN of your choice.&lt;/strong&gt; Typically at this point, you will be prompted by your CDN provider to add additional DNS records to start using the CDN. Expedited CDN with Heroku will provide a set of prompts to configure the service. The first step is to select the Heroku domain you would like to use with the CDN. Follow the prompts to add additional DNS records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X2Bwcb7h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvdqz232hhdbqcc5ne7o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2Bwcb7h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvdqz232hhdbqcc5ne7o.png" alt="select_domains" width="880" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wait for the DNS to resolve.&lt;/strong&gt; After the DNS has resolved, complete the CDN setup. Add the &lt;code&gt;CDN_HOST&lt;/code&gt; as an environment variable on your production environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it! Once all the DNS changes have propagated, the setup is complete. The very first time a file is requested, the request will go through your Rails application, and subsequent requests will be served via the CDN.&lt;/p&gt;

&lt;p&gt;Here at Simple File Upload, we've taken all of the pain out of using a CDN with Rails Active Storage. We provide a drop-in javascript widget to upload and serve files from a CDN for you. &lt;a href="//simplefileupload.com/pricing"&gt;Try it free for 7 days!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>rails</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
