-1

I have .net application running on DXA 1.8 and Web 8.5. I am facing issue while publishing binary (pdf) with the same name and different content.

Now the issue is I am not able to see the published PDF with the same name and different content updating on the website. I have tried to disable Client Side Cache by Setting the cache to false

    <caching defaultHandler="longLivedCache" enabled="false">

And also

 <add name="Page" cacheName="noCache"/>
        <add name="ComponentPresentation" cacheName="noCache"/>
        <!-- DXA objects: -->
        <add name="Binary" cacheName="noCache" /> 
        <add name="PageModel" cacheName="noCache"/>
        <add name="IncludePageModel" cacheName="noCache"/>
        <add name="EntityModel" cacheName="noCache"/>
        <add name="Navigation_Static" cacheName="noCache"/>
        <add name="Navigation_Dynamic" cacheName="noCache"/>
        <add name="NavTaxonomy" cacheName="noCache"/>
        <add name="BinaryPublishDate" cacheName="noCache"/>
        <add name="CIL-BROKER" cacheName="noCache"/>
        <add name="CIL-DYNAMIC" cacheName="noCache"/>
        <add name="CIL-LINKING" cacheName="noCache"/>
        <add name="CIL-INTERNAL" cacheName="noCache"/>

Disabled ViewModel Cache

     <add key="viewModel-caching" value="false" />

On CD side I have disabled Object Cache for Content Service and Discovery Service

 <ObjectCache Enabled="false">

Also

Restarted the services cleared browser cache recycled application pool restarted IIS

I still see the old pdf in the link. In the binaryData folder, there is still the old pdf file. It means the file is not being updated over there. I can see the other binary files are showing the modified date over there

  • This is happening as the pdf was opened in the browser and it was locked So DXA was not able to update binary folder. – Manish Mehmood May 2 at 15:39
  • Does that mean you have solved the problem yourself? If so, please create an Answer and Accept it yourself. – Rick Pannekoek May 3 at 8:36
  • what you mean here "publishing binary (pdf) with the same name and different content" with TCM id in the binary filename or without TCM id in the filename? – Velmurugan May 5 at 12:26
2

The issue was with some piece of DXA 1.8 code here

if (localization.LastRefresh.CompareTo(lastPublishedDate) < 0)
                {
                    //File has been modified since last application start but we don't care
                    Log.Debug(
                        "Binary with URL '{0}' is modified, but only since last application restart, so no action required",
                        urlPath);
                    return localFilePath;
                }

Which is fixed in the updated version of DXA 2.0. After commenting out this code, The binaries with the same name started appearing after publishing and wothout having application pool recycled.

  • I really do not know who upvoted this answer. The solution provided here is irrelevant to the question above. I have already provided the above solution under your other question. The fix that you provided here is also NOT correct, since JSON files need not refresh everytime. Help is needed from everyone to keep community clean. tridion.stackexchange.com/questions/19551/… – Shiva May 11 at 18:06
  • @shiva The code in question looks relevant to a cache invalidation problem. These things are notoriously tricky to diagnose correctly, but Manish is saying that removing this code fixed his problem, which seems reasonable. You're saying he's wrong, and I can see that you've invested time and effort in trying to give a good answer yourself. It's not immediately obvious that this is about variants or being unable to delete binaries. Care to give us some further explanation? – Dominic Cronin May 13 at 16:59
  • @DominicCronin, I have worked with DXA caches long enough to realize that it can be tricky. We do not want developers barking the wrong tree! Did you have a chance to review the following stack exchange question by the same user? tridion.stackexchange.com/questions/19551/…. The solution is already being provided to that question. It would only make sense to mark this a duplicate and enter an issue in Github. Also, above change would cause all configuration (JSON) to be refreshed. There is also a character limitation for comments :). – Shiva May 14 at 15:57
0

Based on your question and explanation, I am guess that you are publishing the binaries with different variant IDs. Do you have any customization on your templates to publish the binaries with different variants? SDL will NOT let you delete the binaries, without unpublishing them. You could have renamed the binary in the CME and published a new version; which would lead to your old binary being an orphan in the broker database. In either case, you will have to fix the root cause to avoid issues in the future.

I suggest that you first check your BINARYVARIANTS table for binaries, before treating the application for a cache issue. If the above is the case, the binary will still be downloaded; even when you delete the item from the BINARYDATA folder.

If you are ending up with orphans, you will have to create a UNPUBLISH package and manually place it in your worker process queue or will have to follow the LINK, if you are using legacy publishing.

If you update your question with relevant information based on your investigation, we will be able to provide your alternative suggestions.

  • Can you explain why your answer covers variants and unpublishing? If it's a caching issue, then this is an answer to a different question, isn't it? And if, as you say, the correct resolution is to treat the two caching questions as duplicates, then I can't see what this answer is for. Can you explain it a bit further please? – Dominic Cronin May 15 at 19:12
  • @DominicCronin, I dont mean to be rude but I am closing the discussion on this. If the question was updated, an alternative solution would have been posted. I have tried to be nice in trying to explain that it is misleading to the reader and to anyone who might face the issue in the future. My argument is not "MY ANSWER" is the correct one but the accepted solution is the "WRONG ONE". If you cannot see that as a moderator, we can agree to disagree. Let us not waste any more time in trying to explain two different perspectives. Peace now :)! – Shiva May 17 at 14:46
  • You asked for a moderator intervention, so I think it was fair to ask you to explain your reasoning. In general, the hope is that the normal voting process takes care of this kind of thing without the moderators having to get involved. That's probably also the way to handle this one. Anyone with a direct interest in the issue will presumably read your answers in detail and vote accordingly. – Dominic Cronin May 23 at 6:00

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.