Expand my Community achievements bar.

SOLVED

DTM Production Embed Code Never Caches? [SOLVED] It is getting cached

Avatar

Level 2

Is this true? Or am I reading the HTTP response headers wrong?

[img]dtm-http-header.png[/img]

 

It seems like all the scripts from DTM are not cached.  I am new to DTMs, and it just seems wrong to not cache anything client-side.

 

[SOLVED]

I was reading the headers incorrectly and DTM code is getting caching by the browser.  Thanks for all your responses.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Per your screenshot, the headers/responses indicate that your browser loaded a cached version of the script file.

The 'cache-control' in the response is set to '0' which, effectively, means that the browser should check the last-modified date and only load the file from the browser cache if the cached file is the same age or newer. (If 'cache-control' was set to 'no-cache', then it would mean the server was telling the browser to never load from cache, i.e. always load from the server.)

The '304' response confirms this - it means the browser followed the server's instructions. The browser compared last-modified dates, finding that the file on the server doesn't have a newer modified date, so it just loaded the file from its cache.

HTTP headers, including 'cache-control', are not a simple concept to understand. If you'd like to better understand, you might try reading through the spec, or doing a search to find some of the more human-readable explanations out there.

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Per your screenshot, the headers/responses indicate that your browser loaded a cached version of the script file.

The 'cache-control' in the response is set to '0' which, effectively, means that the browser should check the last-modified date and only load the file from the browser cache if the cached file is the same age or newer. (If 'cache-control' was set to 'no-cache', then it would mean the server was telling the browser to never load from cache, i.e. always load from the server.)

The '304' response confirms this - it means the browser followed the server's instructions. The browser compared last-modified dates, finding that the file on the server doesn't have a newer modified date, so it just loaded the file from its cache.

HTTP headers, including 'cache-control', are not a simple concept to understand. If you'd like to better understand, you might try reading through the spec, or doing a search to find some of the more human-readable explanations out there.

Avatar

Level 3

Hi,

 

Here is an article that talks about embed code (how to add them) http://adobe.ly/1fD4Gm7 . You may refer to this article as a start. Please let us know if you need additional support. Would be glad to assist.

 

Thanks,

Avik

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----