This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
My HTML5 Application Cache Manifest is caching everything
I have made an webapp that could be cached, however the cache created a lot of problems, so I need them all to clear their cache.
Can this be done automatically on my server?
Would any these options work?
change <html manifest="cache.appcache"> to <html>
remove the cache.appcache file from the server
add NETWORK: title above all resources
Relaying on the specification the first two options should do the work. because when the manifest is not reachable a browser should remove all cached data.
https://stackoverflow.com/a/8817490/1482507
Related
This question already has answers here:
Absolute URLs omitting the protocol (scheme) in order to preserve the one of the current page
(3 answers)
Closed 5 years ago.
Why do both these work when embedding a video iframe in a Rails application?
<iframe src="//player.vimeo.com/video/...>
and
<iframe src="https://player.vimeo.com/video/...>
Please enlighten me. I've seen it both ways. Which is preferable?
Using // infers the protocol from the URL from which the root page is served. Navigating to a site https://yoursite.com would mean all // links would also be served using HTTPS. This can be helpful if you're running the same page in a local environment that is using HTTP, and don't want to change it when pushing it to a production environment served using HTTPS.
I am developing a site using PHP, and I was a bit mislead by how Appcache works; it turns out that it also caches the current page. Which, in the case of a PHP app, is a problem. :)
I'd still like to cache my javascript, css and images on the client, but not my actual generated page. What is a good alternative for that? Just the plain old cache headers? The problem I see with them is, that they still produce requests. I am trying to mimize the amount of requests a client needs to make - this includes 304s.
As you might have found out by now, appCache is in the process of being deprecated and will sometimes disappear. It was a good solution for offline applications (static pages with variable data), but not as a cache for static files in dynamic pages.
You could try to include a blank page with a manifest in a hidden iframe in your dynamic pages, but still only pages present in the appCache would use the static resources downloaded from the manifest; the other pages would check the live static resources from the server anyway (the only part of the manifest which is valid everywhere is the "fallback" part).
So your best option is to check your cache headers as suggested by Marged, as it IS possible to avoid server access indefinitely for a static resource.
You could dig what the ServiceWorkers cache does, but I'm not an expert in the field (for now).
This question already has answers here:
How to Disable Copy Paste (Browser)
(12 answers)
Closed 8 years ago.
I am developing an Online Exam rails app. In the Examination interface, I want to prevent the copy(ctrl+c), paste(ctrl+v), right click and selection functionalities. How I would be able to prevent it using javascript? Please help me to have a better solution for this.
Thanks :)-
This depends on the client's browser, so you'll need to add the appropriate JScript to your page. Note that this only works if Javascript is enabled on their browser (it generally will be).
The title says (quite) all: I would like to distribute an app with some HTML pages preloaded into the local Documents folder (they reflect the content of a mini mobile site available on the internet); then, when the contents of the pages are updated, the local HTML files into the app should be updated, so that the user can browse the updated informations also when not connected to the internet.
The app has to work since the first start, thanks to the preloaded pages, and then update itself periodically (I didn't need to check the modify date/time of the single files, it's enough to check and update them when the local copies are older than x days).
The problem: I think I can do it all, but I was asking to myself if is there some framework/class that does it automatically, because it sounds to be a pain :)
Consider using ASIHTTPRequest. Check out this SO question.
Specifically, you might want to look into ASIWebPageRequest:
download complete webpages, including external resources like images
and stylesheets. Pages of any size can be indefinitely cached, and
displayed in a UIWebview / WebView even when you have no network
connection.
I've also used AFNetworking for my own personal projects and it's made my life 10x easier. On the AFNetworking FAQ page, there's a question regarding caching mechanisms for offline viewing. It mentions that NSURLCache in iOS 5 introduced support for caching to disk for offline use - but only for http. If you need to cache https, consider using SDURLCache.
Here's a short additional resource in regards to network caching for iOS.
Read the section titled iOS network caching
If you are looking at pre popping your iOS app with the equivalent of a browser cache then
https://github.com/rs/SDURLCache might be something to look into.
It hooks in with existing NSURLConnection frameworks such as AFNetworking and you just need to set the correct cache policy in your NSURLRequest.
Given its open source you should be able to figure out how where to place your data so it loads it without fetching from the server the first time then just specify when you want the cache to purge itself so it fetches it from the server?
This question already has answers here:
Dealing with < in tw:counturl addthis plugin
(2 answers)
Closed 3 years ago.
I have added a Addthis plugin for blogspot for social networking sharing. The tweet count button for some reason is showing zero always, though the link has been tweeted multiple times.
I have verified using http://cdn.api.twitter.com/1/urls/count.json?url=
My blog website is http://rohit-cricket.blogspot.in/2012/10/turning-twenty-three-and-counting.html
There is no point of pasting code here, as Addthis expands when the page is loaded. It can be seen using Inspect element of google chrome.
Please help
Twitter describes a couple possibilities as to why your count may not be incrementing:
To improve performance we cache the count before displaying it. The cache is updated frequently but on some occasions it may look like your count is not increasing while the cache is updated. In addition, the count only includes public Tweets meaning a Tweet from a protected account will not cause an increase.
Additionally, there is currently a requirement that your server support HTTP HEAD requests in order to update the count properly. An easy way to check this is to use the command-line curl program, passing the -I (capital i) flag. A successful request should have a HTTP 200 OK response
Source: https://dev.twitter.com/docs/tweet-button/faq#count-api-increment
Also, try updating the link to tweet:
<a class="addthis_button_tweet" tw:counturl="http://yoururltocount.com/">
Found answer here: http://www.addthis.com/forum/viewtopic.php?f=4&t=30188