Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

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

Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Why you should set HTTP post encoding

1 minute read

Recently, while working with the double opt-in process that employs an API to trigger messages, I encountered an issue where Latin characters were not captured correctly in the triggered send data extension. I have found that the SFMC HTTPPost uses, by default, WindowsCodePage 1252 encoding, which can cause issues with accented characters such as ž, […]

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

Validation issues With Data Extension Columns _dat, _call, _from

less than a minute read

Data extension column names with _dat, _call, _from, _join suffix will fail to validate, due to using old style JOIN The fix is really easy you only need to wrap the column name like [test_from] and the problem with validation is history If you know more suffixes that will throw an error let me know

Continue reading
Adobe Campaign Classic REST over SOAP
Adobe Campaign, Marketing Automation

Build REST over SOAP API in adobe campaign: Complete Guide

4 minutes read

If you’re familiar with Adobe Campaign Classic, you may have noticed that it utilizes the SOAP (Simple Object Access Protocol) API. We live in an age where REST is taking over, and the good old XML SOAP is slowly being forgotten. To me, as an old-timer, I can confidently say that it doesn’t make any […]

Continue reading
Marketing Automation, Salesforce Marketing Cloud

Add reCAPTCHA to landing page form in salesforce marketing cloud

3 minutes read

Last time we implemented recaptcha for this blog that is build on WordPress CMS. You can read the article here. Today I will show you, how to implement same recaptcha from google but on Salesforce Marketing Cloud Pages. To register your cloud page, you will need to register each domain separately, visit  google recaptcha and […]

Continue reading
Adobe Campaign Classic Incrememental query
Adobe Campaign, Marketing Automation

Incremental query activity: All you need to know

2 minutes read

Adobe Campaign Classic provides a range of activities that allow you to query data from your database. Today we will take a look at the incremental query, which allows you to periodically select a target based on a specific criteria, while excluding individuals who have already been already targeted. The population that has already been […]

Continue reading