I'm working on an older Aurelia application running aurelia-cli v1.3.1 and requirejs v2.3.2 and am experiencing some browser caching headaches. Clients are reporting that old content is showing and/or the application hangs after a deployment. I've deduced that Chrome and other popular browsers are caching the bundle files from previous versions. Browser hangs are caused by older (versioned) bundles being cleaned up after each deployment.
I've tried the following:
Enable revisions in the options section of under build of the aurelia.json file
Execute a PowerShell script to delete old bundles on the server during the deploy.
Execute a PowerShell script to delete old index.html file on the server during the deploy.
The bundles are being versioned correctly as per this screenshot after a build:
However, the same issues persist. I figured maybe the index.html was being cached so that led me to pursue point 3 above. The project is due for an upgrade and more recent versions of the aurelia-cli paired with webpack seem to handle this issue more reliably, but for the mean time until the upgrade, is there anything more I can do to prevent browser caching?
Thanks!
Related
I have installed the GWT SDK version as 2.8.1. I am able to run the application in GWT with Jersy. But, when I try to run the application in GWT Development mode(Super), URL is generating like http://127.0.0.1:9876. When I place this URL in browser not loading the expected UI page. I am getting the page like,
When I click on Dev Mode On button, I am getting this page.
Even I clicked on module name (gwtsample), then I am getting the page like below,
I have even added the GWT extension in browser level and tried the same. But, still no luck.
Instead of trying with the eclipse downloaded GWT SDK, I have externally downloaded the same version of GWT SDK and applied in the Project Properties > GWT > General Settings. Still, facing the same issue only.
I have observed one more thing is, in project facets GWT version is showing like 1.0 where originally I am using 2.8.1 version of SDK. My project is configured with Maven.
I have even gone through multiple questions and solutions which are mentioned in stackoverflow as well as other websites, still, no solution found.
Links which I referred was,
GWT Super Dev Mode
Debugging in GWT Super Dev Mode?
GWT Super Dev mode and in production
some other as well...
You have to compile your GWT application and host in a webserver.
Then navigate to this webserver with your browser. And finally press the DevModeOn bookmarklet to switch to superdevmode.
Drag the bookmarklets (Dev mode on/off) to your bookmarks bar
Compile your gwtsample project into a war
Deploy the war into a webserver like tomcat or jetty
Take your browser (Chrome highly recommended for GWT debugging) and navigate to your installation : for example http://localhost:8080/gwtsample
Now you are just seeing your compiled version in the browser
Next hit the "Dev mode on" bookmarklet.
You will see a message in the browser that compilation is taking place
Now you are in SuperDevMode
Change something in your code
Hit F5 in the browser. Now a recompile will happen and you will see your changes
You can always hit "Dev mode off" to switch off superdevmode. Now you will just see your original compiled application.
Extra : if you are using Eclipse I highly recommend using the branflake plugin : https://github.com/gwt-plugins/gwt-eclipse-plugin
He has some great videos of how to use it : https://www.youtube.com/watch?v=DU7ZQVLR5Zo&list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT
This way you don't even need to compile and host in some webserver as you can run with an embedded Jetty webserver.
You need a HTTP server to serve your HTML host page and webapp (Tomcat, Jetty, Wildfly, Apache+PHP, Rails, choose whatever you need).
Then, launch GWT's CodeServer with -launcherDir pointing to where your webapp lives. It will create a *.nocache.js specific for SuperDevMode, possibly overwriting your production one.
Now, load your webapp as usual from the web server, the specific *.nocache.js will compile your sources on the fly.
If you can live with a simple servlet container, then DevMode (instead of CodeServer) will do all the above setup automatically: use -war instead of -launcherDir.
You shouldn't need to open the CodeServer URL (on port 9876 by default) or use the bookmarklets with any recent GWT version, starting with 2.7.
Good afternoon,
I have problems with the Liferay 6.2 sass generator.
In production I make any CSS in the portlet changes and I can not see the changes in the browser "clearing cache". I go to tomcat webapps and I see that the changes are correct, and that it has deployed well.
But when I go to the browser and access the server I see that the changes in CSS are the old ones.
I have also manually set up the .sass-cache file but it does not play my browser changes.
I think the solution would be to delete the portlet from the webapss and re-deploy .. but of course it is production ..
Do you know any other way ??? Has it happened ??
A greeting!!
We have our own OSGI plugin with a set of custom code and some java libraries that we use cross projects. It is installed on servers via an update site and imported on developers Domino Designer.
It is working fine up to FP4, but in Domino Designer it is not added to bundles after FP4. For servers and Notes clients it works fine up to FP6 for which we have tested so far.
Tested now with FP7 on my Domino Designer, and the plugin installs fine both via update site and via manual import. However each time I open a database using this library I get build errors. It solves by going to the code, on the error select correct project configuration and adding our plugin to the required bundles. When I close the database and open again, I have to do the same process and we have the same problem with all databases using this plugin.
I have tested starting Notes with the osgi console, but all reports as it is installed normal there.
When viewing in package explorer before fixing the bundle I can see that the plugin is missing from Plugin dependecies and gets added there when doing the fix.
I just installed a fresh Domino Designer for a new user now and upgraded him directly to FP7. He got exactly the same problem. Downgrading him to FP4 solves the problem.
Anyone having the same problem or have ideas to how it can be solved?
I had a repository with code that I was testing via running a server at localhost. The standard procedure was to start Apache-Tomcat-7, re-build the project using Maven and deploy it.
After a while of coding I decided to git stash current changes, then built and deployed the old version, it ran correctly in all browsers. After that I called git stash applyand once again built and deployed the created .war file. However, despite the correct version of code both in generated war and in the deployed .war, now none of the browsers see the new applied version.
I tried Ctrl+F5, removing cached files, shutting down Tomcat & deleting the logs & starting it again. And yet the changes, despite being correctly deployed, don't appear in browsers when I navigate to localhost.
How to fix it, what am I doing wrong?
It's possible the web application with your new code built correctly but is not deploying due to an error in the web.xml, init() or classloaders.
Look for a pair of lines in the catalina.out file that looks like this:
INFO: Deploying web application archive /usr/local/tomcat/apache-tomcat-7.0.63/webapps/web-apps#uits#qr.war
INFO: Deployment of web application archive /usr/local/tomcat/apache-tomcat-7.0.63/webapps/web-apps#uits#qr.war has finished in 5,123 ms
If you see an error after the "Deploying" line and/or no "Deployment" line, that might explain the issue.
I'm using Jasper Reports as part of my Spring application. I deploy my application on a Tomcat 6 server through eclipse, so my project is a WTP project. The problem I have is that when I change a Jasper Reports file (jrxml) I need to restart the server in order to get the changes published. I already checked on the deployment folder and the .jrxml is updated, but for some reason the browser keeps getting the old report, I already cleaned the cache on the browser without luck.
Any ideas on how to solve this, is super annoying when doing development.
I suppose that you use ireport to change .jrxml, when you save changes in that, the eclipse will not be immediately notified that. So you need to fresh your project in eclipse, if necessary, clean and rebuild the project, and redeploy to tomcat.
Also, you can set eclipse to auto build project (Porject-->check Build automatically) and keep refresh the project. When you see the status 'Synchronized' of your project changes to 'Republic' in the 'Server' View, you can restart the server and see the changes. Press 'ctrl+f5' to fresh the page with refreshing all the cache.