Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

SFMC TIP | How to publish cloud page immediately

how to publish cloud page immediatelly

You know the struggle when developing a cloud page application and trying to debug some issues or make changes. You publish the cloud page and wait and wait. Sometimes it takes ages, and other times it is right away. Why does this happen? How can we make it work immediately?

Why we have to endure this?

To answer why, I have found, while browsing the vast internet, that cloud pages are server-cached for performance reasons. Why Salesforce did not introduce a development mode for cloud pages, we do not know, and until that day, we will have to live with workarounds.

Before today, the day I have learnt the ultimate workaround of all time, I was using pretty blunt workarounds, or just waited or went for coffee, or just stared into the wall.

My workarounds before the relevation:

  • Created the cloud always as a new landing page – this way there is no cache
  • Changed the path of the URL component – you need to unpublish, change the path, and publish again.
  • I prayed to the Lord Jesus, so this time it will take less than before. /s



Unpublish page to change path in url to avoid caching

The Solution

The solution has one prerequisite, and that is to have your own web server. I suppose there are plenty of free web servers where you can quickly load HTML code, and it will happily present it to the public.

Your cloud page will only have following code:

%%=TreatAsContent(HTTPGET("https://sfmc.martechnotes.com"))=%%

On the subdomain / domain / web hosting to index.html load you actual html with SSJS, AMPScript.

This way, only the one line of code is cached, and everything else is pulled dynamically every time. As a result, your changes will be reflected every time you update the index.html file on your web server. Isn’t it amazing?

The Solution 2

In case you do not have access to your own web server, you can refer to content blocks that are not cached. This will ensure immediate effects on any changes to your web application. In AMPScript the changes are following:

%%=TreatAsContent(ContentBlockByKey("content-block-customer-key"))=%%

If you fancy SSJS you can use following snippet:

<script runat="server">
Platform.Load("Core","1.1.1");
    var cloudPageCode = Platform.Function.ContentBlockByKey("content-block-customer-key");
    Write(TreatAsContent(cloudPageCode));     
</script>

Oh hi there 👋
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

#AMPScript #cloud page #programming #ssjs
Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in solving problems, automating processes, and driving innovation in my clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified).

Additionally, I serve as a community advisor for Adobe Campaign, offering expert insights and guidance.

In addition to my professional pursuits, I also enjoy exploring various programming languages, CMSs, and frameworks, further enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Leave a comment

Your email address will not be published. Required fields are marked *

Similar posts that you may find useful

Queries in SSJS and AMPScript
Marketing Automation, Salesforce Marketing Cloud

SFMC | Query data extension in SSJS and AMPScript

1 minute read

There’s another topic for which official documentation often lacks sufficient information, but it can be incredibly useful when needed. It’s important to note that in AMPScript, we use the data extension name to reference the table for any query. On the other hand, in SSJS, we utilize the data extension’s external key to reference the … Read more

Continue reading
How to JavaScript in SFMC
Marketing Automation, Salesforce Marketing Cloud

SFMC | How to JavaScript in Marketing Cloud

3 minutes read

Salesforce Marketing Cloud uses JavaScript where a advanced customization is needed e.g. automations, cloud pages and even in message personalization. Last time we discussed how to JavaScript in Adobe Campaign, we discovered that it utilizes an older version of ECMAScript. However, it’s worth noting that Salesforce Marketing Cloud (SFMC) goes even further back and employs … Read more

Continue reading
SFMC tips and tricks
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

SFMC TIP | Google Analytics Integration 1

less than a minute read

When you integrate with Google Analytics, marketing cloud will add tags to all your links. When this happens, all dynamic links will be broken. Links that are defined programmatically as variable, field or attribute with GA integrated will look as if the tracking link also appends google analytics tags. This will make such link not … Read more

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

ACC TIPS | Workflow in pending start

1 minute read

Have you ever found yourself waiting for a campaign workflow to start, only to experience delays or long waiting times? I’ve got a handy trick to share with you that can help you initiate the workflow immediately or significantly faster. I know that campaign managers schedule sometimes can be tight and waiting for pending start … Read more

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign

ACC TIPS | Reselect temporary schema in query

less than a minute read

When working with the Query activity in Adobe Campaign Classic, you have the choice to select either the Temporary schema or the Database schema. If you opt for the Temporary schema, it is essential to reselect it even if it is preselected with a default value. Here’s why it’s important to explicitly reselect the Temporary … Read more

Continue reading