I'm deciding to remove all versions from static content that has been referenced in my Mvc Web Application. but I need caching.
I want to know does the browser cache contents by file name or by content ?
for example if I Bundle a Jquery version 1.6 without version information (i.e jquery.js), and then I put version 1.8 of jquery with the previous file name (jquery.js). what will happen ? does the browser get the new file or not ?
thanks
Bundling generates the cache code in the bundle url(the ?v=12345) via the actual contents of the file, so you will get a different bundle url that the browser will cache each time you change the actual contents of the bundle.
Related
I want to know if its posible to make a plugin for OFSC with cordova integration. I have a web page with a simple HTML plugin, and I want to add SQLite storage into the plugin.
I have tried including the cordova.js reference to the index.html plugin page, and it's loads well, but don't works on the application, When I try to open a database I alwais get an error.
If I load the plugins files outside OFSC context on a cordova package the SQLite plugin works perfectly.
I am not sure if the it is posible or if it's not necesary to load cordova on the plugin index page because I have seen references to cordova on the OFSC package.js file.
thanks in advance
You can only use browser cache to enable your application for offline working. You can use browser local storage or browser's IndexedDB etc in your plugin.
Now exist problem, because I modify css or js files users must clearing clear their browser cache to get newest changes. How to prevent this ? I think, that best way is define assets timestamp, Yii have something special for this ?
I not understand for what is it. After deploy new version static to server you can clear assets folder. After this will be created new assets from last version files.
I have some 4.5.6 installation of TYPO3 and a quite old, modified tt_news extension running.
My client noticed that the indexed search is not working for the news pages anymore.
So i checked, and as I thought the cache entries for the detail pages are not created anymore.
Actually only one cache entry is created, containing the html of the first detail page I requested (through the frontend).
I enabled the adminPanel and it also shows me that no_cache = 1. Why is that? My URL looks like this:
www.mypage.com?id=231&tx_ttnews[tt_news]=2457&tx_ttnews[backPid]=&tx_ttnews[swords]=&cHash=287ca316c98761c2dff769a7d3c6b587
Anyone can help me with that?
There are several places to disable the TYPO3 page cache.
a) It can be set by TypoScript using
config.no_cache = 1
or
page.config.no_cache =1
Check in the TypoScript Object Browser if it is set on this page and check how it is set.
b) It can be set in the page properties.
c) It can be set in an extension. If e.g. your customized version of tt_news contains this code
$GLOBALS['TSFE']->set_no_cache()
the cache for all pages containing the plugin is disabled.
Furthermore the plugin can be made running as a USER_INT like this
$this->pi_USER_INT_obj = 1;
If this is set, then the content of this plugin is not checked. E.g. on the page you opened the admin panel, you have three USER_INT objects. But this is not the problem since you have set "no_cache" which means that the cache for the whole page is disabled.
The problem was related to realUrl. We updated to a new version, and then caching worked again. Looks like realUrl generated invalid cHashes...
I have created a small site, on IIS express all is working fine. I have created on IIS new application and deployed the package to the folder. the server side is asp.net webapi. the bundle configuration is loading fine when i try to enter the home page, how ever the java script files which are referenced on the cshtml page cannot be found
<script src="~/Client/lib/require/require.js" data-main="../../Client/app/requireConfig"></script>
i am getting -
require.js
/Client/lib/require --> 404 cannot be found
and the bundle which works
viewingPanelDirective.js
/NGWeb/Client/app/appComponents/viewingPanel
how can I over come it?
I think i know what might be the cause, i had the same problem myself
in you visualstudio, the js file was running on a url like this
http://localhost:/client/lib/require/require.js
now you published it, and added it as an application to your default site, you would have given it an alias (e.g) "testsite"
meaning that in reality the file is hosted at
http://localhost/testsite/client/lib/require.js
but in reality your site is looking for it (because of the ~) at
http://localhost/client/lib etc etc
Edit in response to comment:
rather than removing the ~ (which you will need to navigate you back to the url root), i would rather just include your app name in the bundles virtual path, like this:
bundles.Add(new styleBundle("~/yourAppName/Content/css")) ....... etc
I also came across this post, I haven't tried it myself but it seems an interesting alternative to my method.
Fixing Relative CSS Paths when using .NET MVC 4 Bundling
Is it possible to run two appcache file in a site. For example in home.html there is home.appcache while in about.html there is about.appcache , each of the file will cache different resources. I want to know if it's possible to cache by pieces.
I've already tried it and it is working,it means that there is no need to download all the resources using only one appcache file, we can use one or more appcache file in a site but we need to put it in different html pages. using this technique only the updated resources will be cached and be downloaded,there is no need to download all resources.