Hi,
I have extended the ActiveRecord::Base class as follows:
lib/activerecord_ext.rb:
class ActiveRecord::Base
named_scope(
:recent,
:conditions => ['created_at > ?', (Time.new - 3.day)],
:order => 'created_at DESC',
:limit => 5
)
end
In config/environment.rb:
require "activerecord_ext"
This works fine unt...
I'm trying to teach myself php... so please be kind and bear with me.
I'm trying to follow this tutorial on how to cache files... the page I want to cache is HTML only, so I've modified the php to just deal with data. I know the caching part is working, it's when I try to modify the results that I get a "Catchable fatal error: Object of...
When you add an item to the System.Web.Caching.Cache with an absolute expiration date, as in the following example, how does Asp.Net behave? Does it:
Simply mark the item as expired, then execute the CacheItemRemovedCallback on the next access attempt?
Remove the item from the cache and execute the CacheItemRemovedCallback immediatel...
Esteemed Overflow-ers of the Stack,
So I've recently been trying to fully wrap my head around HTTP resource caching. Notably, right now I'm looking at simply the caching of a single, sprited image which is used for rendering icons / small images through out the page. Here's an explanation of the odd behavior I'm seeing:
So, on the...
In my application, I am sending periodic cron and background task requests to refresh the cache of pages. While sending a force_refresh kwarg from the view is easy, there's no apparent way to send the force_refresh kwarg to methods being accessed from the template. There are plenty of these I'm using, and it would just make things more c...
Hi folks,
i'm trying to use OutputCaching in my ASP.NET MVC website. Problem is, when i try and change the value of one my querystring params, it's returning the data for the first item that was requested!
Here's my code (with the param names changed) ...
[ApiAuthorize]
[HandleErrorAsJson]
public class SearchController : Controller
{...
would like your comments.
Eg: When user first visit www.testing.com/productdetailpage.asp
I will use caching- store the whole page into productdetailpage.html
When the user go to reopen productdetailpage.asp, user will be redirected to www.testing.com/productdetailpage.html
It means they will see productdetailpage.html, not .asp
Is ...
Basically, I have a form that has some pretty date-sensitive info in it. The risk with the form being cached is that:
1) The user may not notice that the date is wrong and simply think that the server has loaded their saved data (which it should, if the date was correct). They then submit the data and it gets saved to the wrong date. Th...
I want to create a "temporary cache lookup" to speed up a file lookup on my webserver.
What I have now is a folder full of images, and if a user requests an image I use a File.Exists(...) to check to see if the image exists. If it doesn't, download it from another server, and either way, redirect the user to it.
The problem with this ...
I'm confused on ASP.NET MVC caching and authorization and in dire need of some clarification.
My self-made authorization attribute inherits from AuthorizeAttribute. It's overridden AuthorizeCore() method runs every time, even if I set an [OutputCache] directive on a controller action. I got that part.
Now the mind bender for me: Author...
I have an ASP.Net MVC web app that includes a set of Forums. In order to maintain flexible security, I have chosen an access-control-list style of security.
However, this is getting to be a pretty heavy chunk of data to retrieve every time somebody views the forum index.
I am using the EnterpriseLibrary.Caching functionality to cache ...
I have a dumb simple loop
for alias in models.Alias.objects.all() :
alias.update_points()
but looking into the django QuerySet it seems to keep around a _result_cache of all the previous results. This is eating Gigs and Gigs of my machine and eventually everything blows up.
How can I throw away all the stuff that I won't ever ca...
Is it possible for different NHibernate sessions to share one 1st level cache? I`ve tried to implement it using interceptors and listeners. All works fine except Session.Evict().
public class SharedCache :
EmptyInterceptor,
IFlushEntityEventListener,
ILoadEventListener,
IEvictEventListener,
ISharedCache {
[Thread...
I'm currently looking into methods of implementing server-side caching of roughly 10,000 Google Maps geocoder responses in a J2EE web application. Since Google limits the number of geocoding requests to 15,000 per day, I need a method to store my requests for 24 hours. The requests originate from an XML file that sits on the server, and ...
Does anybody know if the iPhone maintains a cache of previously used font characters?
Recently, while trying to uncover a memory leak near a UITextField controler, I've noticed that the leaks are almost (95%) gone whenever I start writing text that uses only characters from previous attempts.
What seems to happen is that for every d...
The requirement is to cache a large number (100,000 to 1,000,000) of small objects and control the expiration of individual objects based on future events. There is no time component to the expiration.
The cache must be available to a number of application servers (SpringSource dm Server) and ideally should be distributable and error t...
I'm trying to ensure that visitors of my ASP.NET MVC website always have the most-current CSS and Javascript (and not some older cached version).
I tried to realize this by generating a seed value when the application domain starts, and automatically append it to the CSS and Javascript URLs (so now instead of /Content/All.js the link is...
Hi,
Consider the scenario of a typical webapp with JSFs on the front and ejb3, with Hibernate as JPA provider, talking to backend database such as mysql, etc. The main user actions are login and mostly CRUD operations (minus any D(elete) operations). And the App Server is GlassFish of course.
Given this scenario, how and where all woul...
In order to minimize the number of database queries I need some sort of cache to store pairs of data. My approach now is a hashtable (with Strings as keys, Integers as value). But I want to be able to detect updates in the database and replace the values in my "cache". What I'm looking for is something that makes my stored pairs invalid ...
Caching the HTML output of non-important pages (like blog posts) really helps to speed up a site by skipping the loading of the entire system (and rendering time) and just spiting out a pre-made copy of the page. This would be one way you can keep large waves of users to your site index or whatever from eating resources.
However, one o...