2

I am running a DXA 1.2 website with Tridion 2013 SP1. Binaries are being pushed out as DCPs. When I publish a new binary, everything seems to be working as expected i.e; item gets updated in the broker and the item is downloaded to the local filesystem (~\BinaryData\PUBLICATION_ID\images).

I am having a peculiar issue with a binary that has been replaced in the CME with the same name and published to the broker. New page and updates to an existing page are working as expected.

Update : Unpublishing binaries are working as expected as well i.e; gets removed from the broker (Reference Entries and Items) and the filesystem.

Update II I have disabled Tridion Object Cache completely in cd_storage (ObjectCache and ItemTypes are set to cached="false"). I also setup a custom logger in logback.xml for ObjectCache and currently no logs (cache) has been enabled at this layer.

Resetting IIS or admin/refresh is not refreshing the newly updated Binary. The cache settings in my web.config are defaulted to the below.

<add key="CacheSettings_CallBackInterval" value="5" />
<add key="DD4T.CacheSettings.Page" value="5" />
<add key="DD4T.CacheSettings.Component" value="5" />
<add key="admin.refresh.enabled" value="true" />

If I manually delete (invalidate) the file in my filesystem (~\BinaryData\PUBLICATION_ID\images), the newer component is being pulled from the broker.

When modified items (binary components) are published to the broker, I can see LAST_PUBLISHED_DATE being refreshed in the broker database.

SELECT * FROM ITEMS WHERE PUBLICATION_ID = MY_PUBLICATION_ID AND TITLE LIKE '%MY_IMAGE_NAME%'

For some reason, the website is not picking up the CacheSettings from the broker database or Cache is not being invalidated in 5 seconds (per the configuration above). Following are the logs from the Core log.

Am I missing any configuration? Is there a way to debug it any differently? Is there a way to extend BinaryFileManager and write our own custom implementation?

2016-05-11 13:56:52,071 DEBUG ClaimStore - put: uri=taf:request:uri, value=/images/MYIMAGE.png
2016-05-11 13:56:52,071 DEBUG ClaimStore - put: uri=taf:request:full_url, value=https://MYDOMAIN:MYPORT/images/MYIMAGE.png
2016-05-11 13:56:52,071 DEBUG ClaimStore - put: uri=taf:request:headers, value={sm_filterctxtptr=[Ljava.lang.String;@8aa59fb, cookie=[Ljava.lang.String;@67f9722e, cache-control=[Ljava.lang.String;@29b75f56, sm_location=[Ljava.lang.String;@45d41c7f, connection=[Ljava.lang.String;@689af9a9, host=[Ljava.lang.String;@167cfbe6, accept-language=[Ljava.lang.String;@677dc492, accept=[Ljava.lang.String;@71f48252, user-agent=[Ljava.lang.String;@6b980ff0, accept-encoding=[Ljava.lang.String;@4c3e8cbf, upgrade-insecure-requests=[Ljava.lang.String;@1e8a76b4, pragma=[Ljava.lang.String;@14773316}
2016-05-11 13:56:52,072 DEBUG ClaimStore - put: uri=taf:request:cookies, value={s_invisit=true, s_cc=true, s_ev21=%5B%5B'typed_bookmarked'%2C'1462988733231'%5D%2C%5B'other_traffic'%2C'1462988867685'%5D%2C%5B'other_traffic'%2C'1462988868126'%5D%2C%5B'other_traffic'%2C'1462988868496'%5D%2C%5B'other_traffic'%2C'1462988870020'%5D%2C%5B'other_traffic'%2C'1462988871487'%5D%2C%5B'other_traffic'%2C'1462989276372'%5D%2C%5B'other_traffic'%2C'1462989276732'%5D%2C%5B'other_traffic'%2C'1462989278238'%5D%2C%5B'other_traffic'%2C'1462989279156'%5D%5D, s_sq=%5B%5BB%5D%5D, s_fid=64E44A1D527ECE68-0EFF535B42268EA5, gpv_pn=fcllc%3Apublic%3Ahomepage, TAFSessionId=tridion_2f644085-45da-4ed8-87c3-f27762e5d28a, ASP.NET_SessionId=agoyujv2aqmh2ihimptmsojf, TAFTrackingId=tridion_88bb3d08-888d-492b-a773-5f97d7080f8a, s_vnum=14650714MYPUBID30%26vn%3D12}
2016-05-11 13:56:52,072 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;@1dbaf3d9, QUERY_STRING=[Ljava.lang.String;@5cdf3ace}
2016-05-11 13:56:52,073 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=D:\IIS_LOCATION\1WFW_MYPORT\images\MYIMAGE.png, SERVER_PORT=MYPORT, SCRIPT_NAME=/images/MYIMAGE.png, REMOTE_ADDR=REMOTE_IP, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=D:\Inetpub\1WFW_MYPORT, REMOTE_HOST=MYIP, SERVER_NAME=MYDOMAIN, SECURE=false}
2016-05-11 13:56:52,073 DEBUG AmbientRuntime - Is http header processor enabled ?False
2016-05-11 13:56:52,073 DEBUG AmbientRuntime - Is http header processor enabled ?False
2016-05-11 13:56:52,073 DEBUG AmbientRuntime - Is http header processor enabled ?False
2016-05-11 13:56:52,073 DEBUG AmbientRuntime - Is http header processor enabled ?False
2016-05-11 13:56:52,073 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_2f644085-45da-4ed8-87c3-f27762e5d28a
2016-05-11 13:56:52,074 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_88bb3d08-888d-492b-a773-5f97d7080f8a
2016-05-11 13:56:52,074 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore}
2016-05-11 13:56:52,074 DEBUG AmbientRuntime - Begin processing cookie claims.
2016-05-11 13:56:52,074 DEBUG AmbientRuntime - Begin processing cookie claims.
2016-05-11 13:56:52,074 DEBUG AmbientRuntime - Cookie forwarding is enabled: True
2016-05-11 13:56:52,074 DEBUG AmbientRuntime - Cookie forwarding is enabled: True
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - Cookie forwarding for account is set to: False
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - Cookie forwarding for account is set to: False
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - IP address is in the white list: True
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - IP address is in the white list: True
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - Cookie forwarding for current request is allowed: True
2016-05-11 13:56:52,075 DEBUG AmbientRuntime - Cookie forwarding for current request is allowed: True
2016-05-11 13:56:52,075 DEBUG ClaimCookieDeserializer - The list of ClaimsCookies sent to be deserialized is empty!
2016-05-11 13:56:52,076 DEBUG AmbientRuntime - Dispatching OnRequestStart event
2016-05-11 13:56:52,076 DEBUG AmbientRuntime - Dispatching OnRequestStart event
2016-05-11 13:56:52,076 DEBUG ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:devicetype, value=Desktop
2016-05-11 13:56:52,076 DEBUG ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:mobiledevice, value=NotMobile
2016-05-11 13:56:52,077 DEBUG ClaimStore - put: uri=taf:claim:ambientdata:footprintcartridge:acceptlanguage, value=en-US
2016-05-11 13:56:52,081 DEBUG ClaimStore - put: uri=taf:claim:context:ui:android, value=false
2016-05-11 13:56:52,081 DEBUG ClaimStore - put: uri=taf:claim:context:ui:largeBrowser, value=false
2016-05-11 13:56:52,081 DEBUG ClaimStore - put: uri=taf:claim:context:userRequest:fullUrl, value=
2016-05-11 13:56:52,081 DEBUG ClaimStore - put: uri=taf:claim:context:os:model, value=Windows 7
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:os:vendor, value=
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:os:variant, value=
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:os:version, value=
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:userHttp:cacheControl, value=
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:device:model, value=Other
2016-05-11 13:56:52,082 DEBUG ClaimStore - put: uri=taf:claim:context:device:tablet, value=false
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:pixelDensity, value=217
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:vendor, value=unknown
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:inputDevices, value=[]
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:robot, value=false
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:displayWidth, value=800
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:variant, value=
2016-05-11 13:56:52,083 DEBUG ClaimStore - put: uri=taf:claim:context:device:pixelRatio, value=1.0
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:device:version, value=
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:device:mobile, value=false
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:device:displayHeight, value=640
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:browser:imageFormatSupport, value=[PNG, JPEG]
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:browser:model, value=Chrome
2016-05-11 13:56:52,084 DEBUG ClaimStore - put: uri=taf:claim:context:browser:scriptSupport, value=[JavaScript]
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:inputModeSupport, value=[useInputmodeAttribute]
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:vendor, value=unknown
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:stylesheetSupport, value=[css10, css21]
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:markupSupport, value=[HTML5]
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:displayWidth, value=800
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:variant, value=
2016-05-11 13:56:52,085 DEBUG ClaimStore - put: uri=taf:claim:context:browser:cookieSupport, value=true
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:version, value=49.0.2623
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:displayHeight, value=640
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:jsVersion, value=1.8.5
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:inputDevices, value=[]
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:cssVersion, value=2.1
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:modelAndOS, value=Windows 7 Chrome
2016-05-11 13:56:52,086 DEBUG ClaimStore - put: uri=taf:claim:context:browser:displayColorDepth, value=16
2016-05-11 13:56:52,087 DEBUG ClaimStore - put: uri=taf:claim:context:browser:preferredHtmlContentType, value=text/html
2016-05-11 13:56:52,087 DEBUG ClaimStore - put: uri=taf:claim:context:userServer:serverPort, value=
2016-05-11 13:56:52,087 DEBUG ClaimStore - put: uri=taf:claim:context:userServer:remoteUser, value=
2016-05-11 13:56:52,087 DEBUG ClaimStore - put: uri=taf:claim:context:INTERNAL1, value=com.sdl.context.engine.ImmutableContextMap@438dda04
2016-05-11 13:56:52,089 DEBUG BinaryMetaFactory - Finding binary by url MYPUBID ,/images/MYIMAGE.png
2016-05-11 13:56:52,089 DEBUG SessionManagerImpl - No session opened for the current execution thread.
2016-05-11 13:56:52,089 DEBUG SessionProxyMethodHandler - Intercepted call to 'findByURL' while not in session.
2016-05-11 13:56:52,102 DEBUG BinaryMetaFactory - BinaryMetaFactory: Retrieved BinaryMeta instance: 7225
2016-05-11 13:56:52,103 DEBUG ComponentMetaFactory - Started Retrieving ComponentMeta instance
2016-05-11 13:56:52,103 DEBUG SessionManagerImpl - No session opened for the current execution thread.
2016-05-11 13:56:52,103 DEBUG SessionProxyMethodHandler - Intercepted call to 'findByPrimaryKey' while not in session.
2016-05-11 13:56:52,111 DEBUG ComponentMetaFactory - Retrieved ComponentMeta instance: com.tridion.storage.mapper.ComponentMetaImpl@485b8e62
2016-05-11 13:56:52,170 DEBUG AmbientRuntime - Ambient Data context initialization.
2016-05-11 13:56:52,170 DEBUG AmbientRuntime - Ambient Data context initialization.
2016-05-11 13:56:52,171 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore@72e0e90a, thread: Thread-0
  • Are you using DXA .NET of Java? Try setting the DXA log level to DEBUG an see in the DXA log sheds Andy light on what's going on. – Rick Pannekoek May 19 '16 at 17:32
  • Hi Rick - We are using DXA .NET. I am not seeing anything informative in the DXA application site log. – Shiva May 19 '16 at 18:11
  • 2
    Weird. If log analysis isn't helping, I would recommend to use the debugger to get more insight in where it goes wrong. – Rick Pannekoek May 19 '16 at 18:42
  • 1
    +1 for Rick. Stop searching and get debugging to work. And then concentrate on the BinaryFileManager (github.com/sdl/dxa-web-application-dotnet/blob/…) – Albert Romkes May 20 '16 at 7:22
  • 1
    Please note that DXA 1.2 did not have cache headers set (reported in Java repo, but also existing in .NET version, see github.com/sdl/dxa-web-application-java/issues/6), which depending on which browser you use, your image might be cached endlessly by the browser and never actually requested anymore. This was fixed in DXA 1.3. – Bart Koopman May 23 '16 at 15:53
2

I have faced this same issue in the past. The issue isn't DXA nor DD4T. For me, the fix was to enable Tridion Cache Channel Service on both the deployer and your application's cd_storage_conf.xml (and of course making sure the CCS service was running).

If the above doesn't work and you want to do a quick/dirty workaround. You can write a batch script to schedule cleanup of the /BinaryData folder so it will grab the latest binary from the DB

  • 1
    Robert: DXA uses DD4T in-built cache (for 1.2 release). Tridion Cache Channel Service (Object Cache) is a different layer in caching. Refer Albert's blog below albertromkes.com/2012/04/07/dd4t-and-caching – Shiva May 12 '16 at 17:48
  • Sure, I understand that. From your DD4T cache setting, it's already a really low value (5 sec). But your issue seem to be when you publish new binaries with the same name, DD4T application dont know if invalidation is needed or not. When you publish content, it will get a new timestamp in the DB and it's stored in the Tridion object cache. During publishing that's when the CCS invalidates the content and display the new content. You just need to connect it correctly in the storage config – Robert Jin May 12 '16 at 18:05
  • I do understand that DD4T is stateless i.e; it would not know by itself to invalidate the cache but that is what the above DD4T Cache settings do. What are my options if I do have Tridion object cache disabled? Is ObjectCache a pre-requisite for DD4T cache? Can you update your answer with supporting documentation? Thanks again! – Shiva May 13 '16 at 19:05
  • Maybe give this a read and let us know what you think? sdltridionworld.com/articles/… – Robert Jin May 16 '16 at 23:41
  • Thanks Rob. I understand how Object Cache works OOTB. Somehow, I still cannot wrap myself around the solution that DD4T is looking for Tridion Object Cache to do the invalidation (incase binaries with the same name are republished). We don't have Object Cache enabled in our platform (in the short term). I am planning to start a bounty to get more responses. – Shiva May 19 '16 at 15:41
1

After running the BinaryFileManager in DEBUG mode for DXA 1.2, at a high-level; I was able to observe the following

  1. When lastPublishedDate > local.LastRefresh; Return the filePath
  2. When fileModifiedDate > lastPublishedDate; Return the filePath
  3. If the first 2 are false, retrieve the binary from the database

One of the problems that I was facing with condition 2 was when Tridion modules are distributed in different timezones (the lastPublishedDate and fileModifiedDate - from presentation server - were in different timezones). One of the enhancements that was done was to convert the date ToUniversalTime() (with proper null validation); so that we do not run into the above issue. If there is a better way to handle this, let me know!

Once the above was resolved, I ran into an issue with condition 1 - without IISReset - the lastRefreshDate will be less than the last published date. The code writes a DEBUG statement and returns the local path. I included a condition in the first one to only be true when the MIME type extension is "application/json" (since all are configuration are only JSON and we intend to turn off admin/refresh for production anyways). If there is a better way to handle this, let me know!

localization.LastRefresh.CompareTo(lastPublishedDate) < 0 && (MimeMapping.GetMimeMapping(localFilePath).Equals("application/json"))

I am testing the code for all possible use cases while posting for feedback in the community. Thanks for the comments and other suggestions as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.