Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add optional image cache expiry to the imageResize API #87

merged 6 commits into from Jan 8, 2013


None yet
4 participants

b1tr0t commented Jan 4, 2013

No description provided.


b1tr0t commented Jan 7, 2013

@jansepar Can you have a look at this for me?

@jansepar jansepar commented on an outdated diff Jan 7, 2013

@@ -26,6 +26,10 @@ var $ = Mobify.$
+ if (options.cacheHours && typeof(options.cacheHours) === 'number') {

jansepar Jan 7, 2013


If someone sets options.cacheHours as a string, then this will silently fail. Probably bad because I would imagine some people might set the value as a string, for example:

options.cacheHours = 27;
options.cacheHours = '27';

I feel like both of those should work. If the argument IS a string, we can check with isNaN or parseInt to determine if it is a valid number, and throw an exception if it is not a number.


b1tr0t commented Jan 7, 2013

@jansepar Integrated your feedback


johnboxall commented Jan 8, 2013

@b1tr0t we can rely on the backend to provide error reporting and for the most part, JavaScript's type conversion will do the right thing here.

johnboxall added a commit that referenced this pull request Jan 8, 2013

Merge pull request #87 from mobify/image-cache-expiry
Add optional image cache expiry to the imageResize API

@johnboxall johnboxall merged commit 17a78b7 into master Jan 8, 2013

1 check passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment