I want to load images from server and want to save into cache.It means i want to load images from server one time and whenever i again want same image it should not be loaded through server for particular time. How can i do this into angular.The problem is related to image caching if one time image is loaded than it should be stored in the cache memory.
Example:- Suppose there are 4 user on portal and each user have their login i want to set cache storage time for each user how can i do this?
Related
How to delete cache data after firebase image work is done? i have a camera that takes a photo and then gives that photo a URL like this "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540lus%252Fprojectname/Camera/75e75ea1-354f-42ad-9b3b-277414acb3aa.jpg" this URL is generated by "expo-camera" my question is how can I make this URL automatically deletes from user cache without user permission after another firebase URL gets generated by my code logic? how can i make this possible? the purpose of doing this is that the cache URL which is generated by expo-camera loads very fast but my firebase URL takes 6-8 seconds to load and which makes the user experience bad
i am using react native expo how can i make this possible to do that? can i make a auto delte expo url cache
want to create a react application that users upload images and instantly should be interacting with them. I'm not going to upload them into any server. I just want to use them in the user's browser.
For that currently use blobs. I save those blob URL'sin localstorage. But the thing is that after several minutes, those blob images got expired the URL can no longer access the image.
How can I extend blobs expiring time?
Good evening,
I am currently running a website. On my website, when one of the user's clicks on a link, HTML is stored in local storage for that user and the link opens up in a new tab, and grabs the HTML that is stored in local storage, to render the page on the new tab. The issue is that, If the user sends the URL to someone else, the person who received that URL, will not be able to view the page, because the HTML for the page is stored in the local storage for the first user. What is the best way to fix this, so that the User who recieves the URL can view the webpage?
What i can think of right now is instead of using local storage, making an API call that sends back the HTML when a user visits the link.
Imagine this scenario - A user visits their profile page on URL /user/username and the component that loads on this URL has to make 1 GET request to the API in order to obtain the information about the user with that username. So far so good, however, if the user visits another URL and then decides to come back to the profile page with URL /user/username, the component makes a new GET request for the same information that it got earlier which leads to 2 drawbacks - the information doesn't appear instantly as the component has to wait for the GET request and I'm making a second call to the API.
This is why I am wondering if it's possible to somehow cache that information so that when the user visits his profile page again, the component wouldn't have to make a second GET request. Also this cached information should be able to expire after a certain amount of time like an hour so that it is never inaccurate.
Is this achievable and worth it?
I personally would first try the http-caching solution as mentioned by "Sudhakar RS", but next I would try session storage. There is a vue-sessionstorage plugin as well. Of course your data then would be valid for the session. Should your session be longer than the hour you mention you would have to manually handle that as part of the data you save with a timestamp. There is a sizelimit of I think 5MB for all session storage data. If you need more then I would go with what "Hung Nguyen" suggested.
You can use browser Local Storage or WebSql or IndexedDB to store data on browser but be careful, they has limit size.
You should cache data on server side instead client side, by this way you will have more privilege to manage your data (caching size, flush cache, ...)
I need a solution based on java script(cookies), which could save the user selected preferences and render the output(html pages) acc. to the cookie saved.
Here is the situation:
Lets say user starts from page1 and navigates to page2(having 40-50 hyperlinks) and there he selects or clicks one of the hyperlink and get directed to the target page(there will be 40-50 pages corresponding to those 40-50 links).
So all i need is to automate the whole process, so that after first visit user's selection could get saved and he will directly get navigated to final target(It will be one of the page from 40-50 pages).
Any code-snippet will highly be appreciated..
mrana
I am curious to know why can't you do this in a preference table on the server side. Cookies can be removed from the browser (which would force users to go through that step again) and storing 40-50 cookies in the browser is not a good solution, as cookies get transmitted to every HTTP request so it would waste users' bandwidth.
If you have these settings/preferences stored on the server side then you can easily determine where to send the user when he logs in to your site, instead of extracting those information from the cookies.
Alternatively you can store these preferences in localStorage which provides bigger storage for storing key/values. The downside is that you need to load a bootstrap JS first which will read the settings from localStorage and decide where to redirect the user.
But IMHO I'd still go with a server side solution if I have to store 40-50 preferences.
Note: Cookies can only have 4KB of data, this is a limit.