Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Intraweb caching JavaScript files (Priority support)
#1
I am using Intraweb 15.3.10 with C++ Builder 10.2.3
I am using Bootstrap 5.3 templates with my Intraweb application.
The template loads some JavaScript files:
[font=Consolas, "Courier New", monospace]      <script src="bootstrap-js/bootstrap.bundle.min.js"></script> 
      <script src="wysiwyg-editor/dist/js/wysiwyg.js"></script>  [/font]


Both Js files are in the wwwroot and Templates folders. Unfortunately I noticed that even if the Js is modified, Intraweb is using an old version.
The changes I make in [font=Consolas, "Courier New", monospace]wysiwyg.js[/font] are not reflected in the Browser during the execution of the program. When running the browser is showing the code below for a click on a button:

                            content += '<div class="form-group form-group-sm">';
                            content += '    <div class="form-row">';
                            content += '        <label class="col-xs-12 col-sm-4">Class:</label>';
                            content += '        <div class="col-xs-12 col-sm-8">';
                            content += '            <input type="text" class="form-control" id="urlClass" placeholder="CSS class name..." />';
                            content += '        </div>';
                            content += '    </div>';
                            content += '</div>';



But the real code in the Js file is below:
[font=Consolas, "Courier New", monospace]
            content += '<div class="mb-3">';
            content += '    <div class="row mb-3">';
            content += '        <label class="col-12 col-sm-4">Tile:</label>';
            content += '        <div class="col-12 col-sm-8">';
            content += '            <input type="text" class="form-control" id="urlTile" placeholder="Title of link..." />';
            content += '        </div>';
            content += '    </div>';
            content += '</div>';[/font]


[font=Consolas, "Courier New", monospace]So the 2 codes which are supposed to be from the Js file are different!!
It is not related to the browser because I cleared the cache and tried 2 different browsers.
[/font]

[font=Consolas, "Courier New", monospace]So it is Intraweb which is caching the wrong version and using it ignoring the changes I am making![/font]
[font=Consolas, "Courier New", monospace]In the browser, the Js version used is located at http://localhost:20300/[font=Consolas, "Courier New", monospace]wysiwyg-editor/dist/js/wysiwyg.js[/font][/font]

I tried to relocate the application cachedir, TIWTemplateCache::Instance->ClearCache(). But nothing is resolving the issue!

So, where is Intraweb is getting this old and wrong version from?
Reply
#2
It's getting the old version from it's internal template cache.

You can clear the template cache when using the SA-GUI version from the menu:

   

You also can disable the template cache while debugging using this property of the ServerController

DisableTemplateCacheOnDebug = True

If you modify the template in production you need to either restart the application or clear the template cache programmatically 

The new template cache feature has been described here when 15.3.0 was released:

https://www.atozed.com/2023/04/whats-new...aweb-15-3/
Reply
#3
I already tried most of those solutions before! But unfortunately none worked!
I even cleared all possible temporary files on my computer and rebooted it! Issue not resolved!
The only one I did not try was SA-GUI Tools > Reset Template cache.
I just tried it but the issue still not resolved!
So its seems that I will be obliged to do it myself manually!
Where is located the template cache on the local disk?
Reply
#4
I'm 100% sure that Reset Template Cache works as it should. I just tested and it works perfectly. Besides that, by default, while debugging the template cache is not active, so if you are debugging it there is no need to reset it.

If it doesn't work in your case, try clearing the browser cache.

There are no template cache on disk. The reason for the cache to exist is to skip the disk file loading.
Reply
#5
I just tried it!
By default the browser is configured to clear all cache when it is closed!
But I will do it manually and I will let you know!


-------------------------------------------------------------------------

It is an external JavaScript file which is loaded by the template!06:04 PM

I usually test my application in Firefox and Chrome.
I just tried in Opera and Edge and it is the same old code!06:07 PM

I think I found the problem. Please give me few minutes.06:11 PM

I thought that it was loading the minified version wysiwyg.min.js instead of the version wysiwyg.js loaded by the template.

But I updated the minified version to be the same as the normal version and I am still seeing the old and wrong version running in the browser!


Attached Files Thumbnail(s)
       
Reply
#6
What part of the phrase: "The cache is in memory and when you restart the application the cache is obviously cleared" you didn't understand?

If you restart your application and the file you see in the browser is still wrong, the template cache has nothing to do with this. I won't respond to this question again.
You fail to understand the basic principle of very simple and straightforward things. Instead of looking for your own mistakes you want to blame the tool. This is a recurrent situation in your case
Reply
#7
And you, who told you that you can talk to me like I am an idiot!
Who told you talk to somebody who is paying for your services that way!
Which part cannot you understand yourself?
You think that I cannot read a file on my local disk and see the content?
Or how to clear a browser cache?
I am using your applications and facing a behaviour which is not normal at all!!
Why can't you understand that I have to check all the possibilities!
Your own behaviour is recurrent also!
You can keep your help, I do not need it!
Reply
#8
I said to you on Telegram channel, *several times* that, if you restart the application and it still not working, then the cache can't ever, without any doubt, be involved in this. Whatever your problem is, it is not caused by it. IntraWeb can't possibly serve a file that is not on the hard disk, because there is no other way to obtain a file content.

Yet, after all this you said, and I quote "So, it seems that I am not the only one experiencing issues with templates cache!".

Either you are failing to understand these very basic things or you are deliberately ignoring them because you clearly prefer to blame the tool. Pick one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)